Show:

F2.Events Class

Handles Context passing from containers to apps and apps to apps.

Defined in: sdk\src\events.js:1

Methods

Name Description
_socketEmit (
  • event
  • [arg]
)
private

Same as F2.Events.emit except that it will not send the event to all sockets.

emit (
  • event
  • [arg]
)

Execute each of the listeners that may be listening for the specified event name in order with the list of arguments.

many (
  • event
  • timesToListen
  • listener
)

Adds a listener that will execute n times for the event before being removed. The listener is invoked only the first time the event is fired, after which it is removed.

off (
  • event
  • listener
)

Remove a listener for the specified event.

on (
  • event
  • listener
)

Adds a listener for the specified event

once (
  • event
  • listener
)

Adds a one time listener for the event. The listener is invoked only the first time the event is fired, after which it is removed.

Methods

_socketEmit (
  • event
  • [arg]
) private

Same as F2.Events.emit except that it will not send the event to all sockets.

Parameters:

  • event String

    The event name

  • [arg] Object optional multiple

    The arguments to be passed


emit (
  • event
  • [arg]
)

Execute each of the listeners that may be listening for the specified event name in order with the list of arguments.

Parameters:

  • event String

    The event name

  • [arg] Object optional multiple

    The arguments to be passed


many (
  • event
  • timesToListen
  • listener
)

Adds a listener that will execute n times for the event before being removed. The listener is invoked only the first time the event is fired, after which it is removed.

Parameters:

  • event String

    The event name

  • timesToListen Int

    The number of times to execute the event before being removed

  • listener Function

    The function to be fired when the event is emitted


off (
  • event
  • listener
)

Remove a listener for the specified event.

Parameters:

  • event String

    The event name

  • listener Function

    The function that will be removed


on (
  • event
  • listener
)

Adds a listener for the specified event

Parameters:

  • event String

    The event name

  • listener Function

    The function to be fired when the event is emitted


once (
  • event
  • listener
)

Adds a one time listener for the event. The listener is invoked only the first time the event is fired, after which it is removed.

Parameters:

  • event String

    The event name

  • listener Function

    The function to be fired when the event is emitted