Type alias tListenerCallback

tListenerCallback: ((pEvent: InfiniteEvent, pCallbackData: Object | undefined) => void)

Type declaration

    • (pEvent: InfiniteEvent, pCallbackData: Object | undefined): void
    • The tListenerCallback type is the type of a callback that is called when an event is fired.

      When event are fired, registered callbacks are called. Callbacks are installed on objects implementing the EventDispatcherInterface.

      /** 
      * Sample to illustrate how to use the 3djuump infinite signal system.
      */
      import { FilterItemInterface, FilterItemInterfaceSignal } from 'generated/documentation/appinfiniteapi';

      // filter has been created previously
      let lFilter : FilterItemInterface;

      // we want to be notified when events occur
      const lCallbackId : string = lFilter.addEventListener(FilterItemInterfaceSignal.FilterChanged, (_event: any, _pObject: Object | undefined) =>
      {
      // output a fancy message when filter changes
      console.log('filter has changed');
      // and remove the listener
      lFilter.removeEventListenerById(lCallbackId);
      });

      The syntax is very close to the DOM addEventlistener functions.
      Events

      See

      EventDispatcherInterface

      Parameters

      Returns void