ixfx
    Preparing search index...

    Function event

    • Subscribes to an event, emitting data

      Type Parameters

      • TEventArgsextendsRecord<string, any>

      Parameters

      • targetOrQuery: null | string | EventTarget

        Event emitter, HTML element or string. If a string, it will be queryed as a selector.

      • name: string

        Event name

      • initialValue: undefined | TEventArgs
      • options: Partial<EventOptions> = {}

        Options

      Returns Reactive<TEventArgs> & { last(): TEventArgs }

      const r = Rx.From.event(document, `pointermove`);
      r.onValue(event => {
      const { x, y } = event;
      });

      If options.lazy is true (default: false), event will only be subscribed to when the stream itself has a subscriber.

      options.debugFiring and options.debugLifecycle can be turned on to troubleshoot behaviour of the stream if necessary.