kernl API
    Preparing search index...

    Function createVisibilityGate

    • Create the gate that holds a hidden window's traffic until it is visible again.

      Deferral is a privacy and resource measure, not a rate limit: a minimised applet should not be fetching or publishing while the user cannot see it. control envelopes are never deferred so a hidden window can still be closed, themed or asked for its identity.

      Parameters

      Returns VisibilityGate

      A visibility gate for many windows.

      const gate = createVisibilityGate({ config: createGuardConfig('strict') });
      gate.setVisibility('w1', { visible: false, focused: false });
      gate.shouldDefer('w1', 'relay:subscribe'); // true
      gate.defer('w1', { type: 'relay.subscribe' }); // true
      gate.setVisibility('w1', { visible: true, focused: true });
      gate.drain('w1'); // [{ type: 'relay.subscribe' }]