API Docs for: 0.0.1
Show:

Event.Listener Class

Module: event-listener
Parent Module: event

Extends the Event-instance by adding the object Listener to it. The returned object should be merged into any Class-instance or object you want to extend with the listener-methods, so the appropriate methods can be invoked on the instance.

Copyright (c) 2014 ITSA - https://github.com/itsa New BSD License - http://choosealicense.com/licenses/bsd-3-clause/

Should be called using the provided extend-method like this:

Methods

after

(
  • customEvent
  • callback
  • [filter]
  • [prepend=false]
)
Object

Defined in src/event kopie/event-listener.js:30

Available since 0.0.1

Subscribes to a customEvent on behalf of the object who calls this method. The callback will be executed after the defaultFn.

Parameters:

  • customEvent String | Array

    the custom-event (or Array of events) to subscribe to. CustomEvents should have the syntax: emitterName:eventName. Wildcard * may be used for both emitterName as well as eventName. If emitterName is not defined, UI is assumed.

  • callback Function

    subscriber:will be invoked when the event occurs. An eventobject will be passed as its only argument.

  • [filter] String | Function optional

    to filter the event. Use a String if you want to filter DOM-events by a selector Use a function if you want to filter by any other means. If the function returns a trully value, the subscriber gets invoked. The function gets the eventobject as its only argument and the context is the subscriber.

  • [prepend=false] Boolean optional

    whether the subscriber should be the first in the list of after-subscribers.

Returns:

Object:

handler with a detach()-method which can be used to detach the subscriber

after

(
  • customEvent
  • callback
  • [filter]
  • [prepend=false]
)
Object

Defined in src/event/event-listener.js:30

Available since 0.0.1

Subscribes to a customEvent on behalf of the object who calls this method. The callback will be executed after the defaultFn.

Parameters:

  • customEvent String | Array

    the custom-event (or Array of events) to subscribe to. CustomEvents should have the syntax: emitterName:eventName. Wildcard * may be used for both emitterName as well as eventName. If emitterName is not defined, UI is assumed.

  • callback Function

    subscriber:will be invoked when the event occurs. An eventobject will be passed as its only argument.

  • [filter] String | Function optional

    to filter the event. Use a String if you want to filter DOM-events by a selector Use a function if you want to filter by any other means. If the function returns a trully value, the subscriber gets invoked. The function gets the eventobject as its only argument and the context is the subscriber.

  • [prepend=false] Boolean optional

    whether the subscriber should be the first in the list of after-subscribers.

Returns:

Object:

handler with a detach()-method which can be used to detach the subscriber

after

(
  • customEvent
  • callback
  • [filter]
  • [prepend=false]
)
Object

Defined in src/itsa-event/event-listener.js:30

Available since 0.0.1

Subscribes to a customEvent on behalf of the object who calls this method. The callback will be executed after the defaultFn.

Parameters:

  • customEvent String | Array

    the custom-event (or Array of events) to subscribe to. CustomEvents should have the syntax: emitterName:eventName. Wildcard * may be used for both emitterName as well as eventName. If emitterName is not defined, UI is assumed.

  • callback Function

    subscriber:will be invoked when the event occurs. An eventobject will be passed as its only argument.

  • [filter] String | Function optional

    to filter the event. Use a String if you want to filter DOM-events by a selector Use a function if you want to filter by any other means. If the function returns a trully value, the subscriber gets invoked. The function gets the eventobject as its only argument and the context is the subscriber.

  • [prepend=false] Boolean optional

    whether the subscriber should be the first in the list of after-subscribers.

Returns:

Object:

handler with a detach()-method which can be used to detach the subscriber

before

(
  • customEvent
  • callback
  • [filter]
  • [prepend=false]
)
Object

Defined in src/event kopie/event-listener.js:53

Available since 0.0.1

Subscribes to a customEvent on behalf of the object who calls this method. The callback will be executed before the defaultFn.

Parameters:

  • customEvent String | Array

    the custom-event (or Array of events) to subscribe to. CustomEvents should have the syntax: emitterName:eventName. Wildcard * may be used for both emitterName as well as eventName. If emitterName is not defined, UI is assumed.

  • callback Function

    subscriber:will be invoked when the event occurs. An eventobject will be passed as its only argument.

  • [filter] String | Function optional

    to filter the event. Use a String if you want to filter DOM-events by a selector Use a function if you want to filter by any other means. If the function returns a trully value, the subscriber gets invoked. The function gets the eventobject as its only argument and the context is the subscriber.

  • [prepend=false] Boolean optional

    whether the subscriber should be the first in the list of before-subscribers.

Returns:

Object:

handler with a detach()-method which can be used to detach the subscriber

before

(
  • customEvent
  • callback
  • [filter]
  • [prepend=false]
)
Object

Defined in src/itsa-event/event-listener.js:53

Available since 0.0.1

Subscribes to a customEvent on behalf of the object who calls this method. The callback will be executed before the defaultFn.

Parameters:

  • customEvent String | Array

    the custom-event (or Array of events) to subscribe to. CustomEvents should have the syntax: emitterName:eventName. Wildcard * may be used for both emitterName as well as eventName. If emitterName is not defined, UI is assumed.

  • callback Function

    subscriber:will be invoked when the event occurs. An eventobject will be passed as its only argument.

  • [filter] String | Function optional

    to filter the event. Use a String if you want to filter DOM-events by a selector Use a function if you want to filter by any other means. If the function returns a trully value, the subscriber gets invoked. The function gets the eventobject as its only argument and the context is the subscriber.

  • [prepend=false] Boolean optional

    whether the subscriber should be the first in the list of before-subscribers.

Returns:

Object:

handler with a detach()-method which can be used to detach the subscriber

before

(
  • customEvent
  • callback
  • [filter]
  • [prepend=false]
)
Object

Defined in src/event/event-listener.js:53

Available since 0.0.1

Subscribes to a customEvent on behalf of the object who calls this method. The callback will be executed before the defaultFn.

Parameters:

  • customEvent String | Array

    the custom-event (or Array of events) to subscribe to. CustomEvents should have the syntax: emitterName:eventName. Wildcard * may be used for both emitterName as well as eventName. If emitterName is not defined, UI is assumed.

  • callback Function

    subscriber:will be invoked when the event occurs. An eventobject will be passed as its only argument.

  • [filter] String | Function optional

    to filter the event. Use a String if you want to filter DOM-events by a selector Use a function if you want to filter by any other means. If the function returns a trully value, the subscriber gets invoked. The function gets the eventobject as its only argument and the context is the subscriber.

  • [prepend=false] Boolean optional

    whether the subscriber should be the first in the list of before-subscribers.

Returns:

Object:

handler with a detach()-method which can be used to detach the subscriber

detach

(
  • customEvent
)

Defined in src/itsa-event/event-listener.js:76

Available since 0.0.1

Detaches (unsubscribes) the listener from the specified customEvent, on behalf of the object who calls this method.

Parameters:

  • customEvent String

    conform the syntax: emitterName:eventName, wildcard * may be used for both emitterName as well as only eventName, in which case 'UI' will become the emitterName.

detach

(
  • customEvent
)

Defined in src/event/event-listener.js:76

Available since 0.0.1

Detaches (unsubscribes) the listener from the specified customEvent, on behalf of the object who calls this method.

Parameters:

  • customEvent String

    conform the syntax: emitterName:eventName, wildcard * may be used for both emitterName as well as only eventName, in which case 'UI' will become the emitterName.

detach

(
  • customEvent
)

Defined in src/event kopie/event-listener.js:76

Available since 0.0.1

Detaches (unsubscribes) the listener from the specified customEvent, on behalf of the object who calls this method.

Parameters:

  • customEvent String

    conform the syntax: emitterName:eventName, wildcard * may be used for both emitterName as well as only eventName, in which case 'UI' will become the emitterName.

detachAll

()

Defined in src/event kopie/event-listener.js:89

Available since 0.0.1

Detaches (unsubscribes) the listener from all customevents, on behalf of the object who calls this method.

detachAll

()

Defined in src/itsa-event/event-listener.js:89

Available since 0.0.1

Detaches (unsubscribes) the listener from all customevents, on behalf of the object who calls this method.

detachAll

()

Defined in src/event/event-listener.js:89

Available since 0.0.1

Detaches (unsubscribes) the listener from all customevents, on behalf of the object who calls this method.

onceAfter

(
  • customEvent
  • callback
  • [filter]
  • [prepend=false]
)
Object

Defined in src/event/event-listener.js:100

Available since 0.0.1

Subscribes to a customEvent on behalf of the object who calls this method. The callback will be executed after the defaultFn. The subscriber will be automaticly removed once the callback executed the first time. No need to detach() (unless you want to undescribe before the first event)

Parameters:

  • customEvent String | Array

    the custom-event (or Array of events) to subscribe to. CustomEvents should have the syntax: emitterName:eventName. Wildcard * may be used for both emitterName as well as eventName. If emitterName is not defined, UI is assumed.

  • callback Function

    subscriber:will be invoked when the event occurs. An eventobject will be passed as its only argument.

  • [filter] String | Function optional

    to filter the event. Use a String if you want to filter DOM-events by a selector Use a function if you want to filter by any other means. If the function returns a trully value, the subscriber gets invoked. The function gets the eventobject as its only argument and the context is the subscriber.

  • [prepend=false] Boolean optional

    whether the subscriber should be the first in the list of after-subscribers.

Returns:

Object:

handler with a detach()-method which can be used to detach the subscriber

onceAfter

(
  • customEvent
  • callback
  • [filter]
  • [prepend=false]
)
Object

Defined in src/event kopie/event-listener.js:100

Available since 0.0.1

Subscribes to a customEvent on behalf of the object who calls this method. The callback will be executed after the defaultFn. The subscriber will be automaticly removed once the callback executed the first time. No need to detach() (unless you want to undescribe before the first event)

Parameters:

  • customEvent String | Array

    the custom-event (or Array of events) to subscribe to. CustomEvents should have the syntax: emitterName:eventName. Wildcard * may be used for both emitterName as well as eventName. If emitterName is not defined, UI is assumed.

  • callback Function

    subscriber:will be invoked when the event occurs. An eventobject will be passed as its only argument.

  • [filter] String | Function optional

    to filter the event. Use a String if you want to filter DOM-events by a selector Use a function if you want to filter by any other means. If the function returns a trully value, the subscriber gets invoked. The function gets the eventobject as its only argument and the context is the subscriber.

  • [prepend=false] Boolean optional

    whether the subscriber should be the first in the list of after-subscribers.

Returns:

Object:

handler with a detach()-method which can be used to detach the subscriber

onceAfter

(
  • customEvent
  • callback
  • [filter]
  • [prepend=false]
)
Object

Defined in src/itsa-event/event-listener.js:100

Available since 0.0.1

Subscribes to a customEvent on behalf of the object who calls this method. The callback will be executed after the defaultFn. The subscriber will be automaticly removed once the callback executed the first time. No need to detach() (unless you want to undescribe before the first event)

Parameters:

  • customEvent String | Array

    the custom-event (or Array of events) to subscribe to. CustomEvents should have the syntax: emitterName:eventName. Wildcard * may be used for both emitterName as well as eventName. If emitterName is not defined, UI is assumed.

  • callback Function

    subscriber:will be invoked when the event occurs. An eventobject will be passed as its only argument.

  • [filter] String | Function optional

    to filter the event. Use a String if you want to filter DOM-events by a selector Use a function if you want to filter by any other means. If the function returns a trully value, the subscriber gets invoked. The function gets the eventobject as its only argument and the context is the subscriber.

  • [prepend=false] Boolean optional

    whether the subscriber should be the first in the list of after-subscribers.

Returns:

Object:

handler with a detach()-method which can be used to detach the subscriber

onceBefore

(
  • customEvent
  • callback
  • [filter]
  • [prepend=false]
)
Object

Defined in src/itsa-event/event-listener.js:125

Available since 0.0.1

Subscribes to a customEvent on behalf of the object who calls this method. The callback will be executed before the defaultFn. The subscriber will be automaticly removed once the callback executed the first time. No need to detach() (unless you want to undescribe before the first event)

Parameters:

  • customEvent String | Array

    the custom-event (or Array of events) to subscribe to. CustomEvents should have the syntax: emitterName:eventName. Wildcard * may be used for both emitterName as well as eventName. If emitterName is not defined, UI is assumed.

  • callback Function

    subscriber:will be invoked when the event occurs. An eventobject will be passed as its only argument.

  • [filter] String | Function optional

    to filter the event. Use a String if you want to filter DOM-events by a selector Use a function if you want to filter by any other means. If the function returns a trully value, the subscriber gets invoked. The function gets the eventobject as its only argument and the context is the subscriber.

  • [prepend=false] Boolean optional

    whether the subscriber should be the first in the list of before-subscribers.

Returns:

Object:

handler with a detach()-method which can be used to detach the subscriber

onceBefore

(
  • customEvent
  • callback
  • [filter]
  • [prepend=false]
)
Object

Defined in src/event kopie/event-listener.js:125

Available since 0.0.1

Subscribes to a customEvent on behalf of the object who calls this method. The callback will be executed before the defaultFn. The subscriber will be automaticly removed once the callback executed the first time. No need to detach() (unless you want to undescribe before the first event)

Parameters:

  • customEvent String | Array

    the custom-event (or Array of events) to subscribe to. CustomEvents should have the syntax: emitterName:eventName. Wildcard * may be used for both emitterName as well as eventName. If emitterName is not defined, UI is assumed.

  • callback Function

    subscriber:will be invoked when the event occurs. An eventobject will be passed as its only argument.

  • [filter] String | Function optional

    to filter the event. Use a String if you want to filter DOM-events by a selector Use a function if you want to filter by any other means. If the function returns a trully value, the subscriber gets invoked. The function gets the eventobject as its only argument and the context is the subscriber.

  • [prepend=false] Boolean optional

    whether the subscriber should be the first in the list of before-subscribers.

Returns:

Object:

handler with a detach()-method which can be used to detach the subscriber

onceBefore

(
  • customEvent
  • callback
  • [filter]
  • [prepend=false]
)
Object

Defined in src/event/event-listener.js:125

Available since 0.0.1

Subscribes to a customEvent on behalf of the object who calls this method. The callback will be executed before the defaultFn. The subscriber will be automaticly removed once the callback executed the first time. No need to detach() (unless you want to undescribe before the first event)

Parameters:

  • customEvent String | Array

    the custom-event (or Array of events) to subscribe to. CustomEvents should have the syntax: emitterName:eventName. Wildcard * may be used for both emitterName as well as eventName. If emitterName is not defined, UI is assumed.

  • callback Function

    subscriber:will be invoked when the event occurs. An eventobject will be passed as its only argument.

  • [filter] String | Function optional

    to filter the event. Use a String if you want to filter DOM-events by a selector Use a function if you want to filter by any other means. If the function returns a trully value, the subscriber gets invoked. The function gets the eventobject as its only argument and the context is the subscriber.

  • [prepend=false] Boolean optional

    whether the subscriber should be the first in the list of before-subscribers.

Returns:

Object:

handler with a detach()-method which can be used to detach the subscriber

selfAfter

(
  • customEvent
  • callback
  • [filter]
  • [prepend=false]
)
Object

Defined in src/event kopie/event-listener.js:160

Available since 0.0.1

Is automaticly available for Classes. Subscribes to a customEvent on behalf of the class-instance and will only be executed when the emitter is the instance itself.

The callback will be executed after the defaultFn.

Parameters:

  • customEvent String | Array

    the custom-event (or Array of events) to subscribe to. CustomEvents should have the syntax: emitterName:eventName. Wildcard * may be used for both emitterName as well as eventName. If emitterName is not defined, UI is assumed.

  • callback Function

    subscriber:will be invoked when the event occurs. An eventobject will be passed as its only argument.

  • [filter] String | Function optional

    to filter the event. Use a String if you want to filter DOM-events by a selector Use a function if you want to filter by any other means. If the function returns a trully value, the subscriber gets invoked. The function gets the eventobject as its only argument and the context is the subscriber.

  • [prepend=false] Boolean optional

    whether the subscriber should be the first in the list of after-subscribers.

Returns:

Object:

handler with a detach()-method which can be used to detach the subscriber

selfAfter

(
  • customEvent
  • callback
  • [filter]
  • [prepend=false]
)
Object

Defined in src/event/event-listener.js:160

Available since 0.0.1

Is automaticly available for Classes. Subscribes to a customEvent on behalf of the class-instance and will only be executed when the emitter is the instance itself.

The callback will be executed after the defaultFn.

Parameters:

  • customEvent String | Array

    the custom-event (or Array of events) to subscribe to. CustomEvents should have the syntax: emitterName:eventName. Wildcard * may be used for both emitterName as well as eventName. If emitterName is not defined, UI is assumed.

  • callback Function

    subscriber:will be invoked when the event occurs. An eventobject will be passed as its only argument.

  • [filter] String | Function optional

    to filter the event. Use a String if you want to filter DOM-events by a selector Use a function if you want to filter by any other means. If the function returns a trully value, the subscriber gets invoked. The function gets the eventobject as its only argument and the context is the subscriber.

  • [prepend=false] Boolean optional

    whether the subscriber should be the first in the list of after-subscribers.

Returns:

Object:

handler with a detach()-method which can be used to detach the subscriber

selfAfter

(
  • customEvent
  • callback
  • [filter]
  • [prepend=false]
)
Object

Defined in src/itsa-event/event-listener.js:160

Available since 0.0.1

Is automaticly available for Classes. Subscribes to a customEvent on behalf of the class-instance and will only be executed when the emitter is the instance itself.

The callback will be executed after the defaultFn.

Parameters:

  • customEvent String | Array

    the custom-event (or Array of events) to subscribe to. CustomEvents should have the syntax: emitterName:eventName. Wildcard * may be used for both emitterName as well as eventName. If emitterName is not defined, UI is assumed.

  • callback Function

    subscriber:will be invoked when the event occurs. An eventobject will be passed as its only argument.

  • [filter] String | Function optional

    to filter the event. Use a String if you want to filter DOM-events by a selector Use a function if you want to filter by any other means. If the function returns a trully value, the subscriber gets invoked. The function gets the eventobject as its only argument and the context is the subscriber.

  • [prepend=false] Boolean optional

    whether the subscriber should be the first in the list of after-subscribers.

Returns:

Object:

handler with a detach()-method which can be used to detach the subscriber

selfBefore

(
  • customEvent
  • callback
  • [filter]
  • [prepend=false]
)
Object

Defined in src/event/event-listener.js:186

Available since 0.0.1

Is automaticly available for Classes. Subscribes to a customEvent on behalf of the class-instance and will only be executed when the emitter is the instance itself.

The callback will be executed before the defaultFn.

Parameters:

  • customEvent String | Array

    the custom-event (or Array of events) to subscribe to. CustomEvents should have the syntax: emitterName:eventName. Wildcard * may be used for both emitterName as well as eventName. If emitterName is not defined, UI is assumed.

  • callback Function

    subscriber:will be invoked when the event occurs. An eventobject will be passed as its only argument.

  • [filter] String | Function optional

    to filter the event. Use a String if you want to filter DOM-events by a selector Use a function if you want to filter by any other means. If the function returns a trully value, the subscriber gets invoked. The function gets the eventobject as its only argument and the context is the subscriber.

  • [prepend=false] Boolean optional

    whether the subscriber should be the first in the list of before-subscribers.

Returns:

Object:

handler with a detach()-method which can be used to detach the subscriber

selfBefore

(
  • customEvent
  • callback
  • [filter]
  • [prepend=false]
)
Object

Defined in src/event kopie/event-listener.js:186

Available since 0.0.1

Is automaticly available for Classes. Subscribes to a customEvent on behalf of the class-instance and will only be executed when the emitter is the instance itself.

The callback will be executed before the defaultFn.

Parameters:

  • customEvent String | Array

    the custom-event (or Array of events) to subscribe to. CustomEvents should have the syntax: emitterName:eventName. Wildcard * may be used for both emitterName as well as eventName. If emitterName is not defined, UI is assumed.

  • callback Function

    subscriber:will be invoked when the event occurs. An eventobject will be passed as its only argument.

  • [filter] String | Function optional

    to filter the event. Use a String if you want to filter DOM-events by a selector Use a function if you want to filter by any other means. If the function returns a trully value, the subscriber gets invoked. The function gets the eventobject as its only argument and the context is the subscriber.

  • [prepend=false] Boolean optional

    whether the subscriber should be the first in the list of before-subscribers.

Returns:

Object:

handler with a detach()-method which can be used to detach the subscriber

selfBefore

(
  • customEvent
  • callback
  • [filter]
  • [prepend=false]
)
Object

Defined in src/itsa-event/event-listener.js:186

Available since 0.0.1

Is automaticly available for Classes. Subscribes to a customEvent on behalf of the class-instance and will only be executed when the emitter is the instance itself.

The callback will be executed before the defaultFn.

Parameters:

  • customEvent String | Array

    the custom-event (or Array of events) to subscribe to. CustomEvents should have the syntax: emitterName:eventName. Wildcard * may be used for both emitterName as well as eventName. If emitterName is not defined, UI is assumed.

  • callback Function

    subscriber:will be invoked when the event occurs. An eventobject will be passed as its only argument.

  • [filter] String | Function optional

    to filter the event. Use a String if you want to filter DOM-events by a selector Use a function if you want to filter by any other means. If the function returns a trully value, the subscriber gets invoked. The function gets the eventobject as its only argument and the context is the subscriber.

  • [prepend=false] Boolean optional

    whether the subscriber should be the first in the list of before-subscribers.

Returns:

Object:

handler with a detach()-method which can be used to detach the subscriber

selfOnceAfter

(
  • customEvent
  • callback
  • [filter]
  • [prepend=false]
)
Object

Defined in src/event kopie/event-listener.js:212

Available since 0.0.1

Is automaticly available for Classes. Subscribes to a customEvent on behalf of the class-instance and will only be executed when the emitter is the instance itself.

The callback will be executed after the defaultFn. The subscriber will be automaticly removed once the callback executed the first time. No need to detach() (unless you want to undescribe before the first event)

Parameters:

  • customEvent String | Array

    the custom-event (or Array of events) to subscribe to. CustomEvents should have the syntax: emitterName:eventName. Wildcard * may be used for both emitterName as well as eventName. If emitterName is not defined, UI is assumed.

  • callback Function

    subscriber:will be invoked when the event occurs. An eventobject will be passed as its only argument.

  • [filter] String | Function optional

    to filter the event. Use a String if you want to filter DOM-events by a selector Use a function if you want to filter by any other means. If the function returns a trully value, the subscriber gets invoked. The function gets the eventobject as its only argument and the context is the subscriber.

  • [prepend=false] Boolean optional

    whether the subscriber should be the first in the list of after-subscribers.

Returns:

Object:

handler with a detach()-method which can be used to detach the subscriber

selfOnceAfter

(
  • customEvent
  • callback
  • [filter]
  • [prepend=false]
)
Object

Defined in src/itsa-event/event-listener.js:212

Available since 0.0.1

Is automaticly available for Classes. Subscribes to a customEvent on behalf of the class-instance and will only be executed when the emitter is the instance itself.

The callback will be executed after the defaultFn. The subscriber will be automaticly removed once the callback executed the first time. No need to detach() (unless you want to undescribe before the first event)

Parameters:

  • customEvent String | Array

    the custom-event (or Array of events) to subscribe to. CustomEvents should have the syntax: emitterName:eventName. Wildcard * may be used for both emitterName as well as eventName. If emitterName is not defined, UI is assumed.

  • callback Function

    subscriber:will be invoked when the event occurs. An eventobject will be passed as its only argument.

  • [filter] String | Function optional

    to filter the event. Use a String if you want to filter DOM-events by a selector Use a function if you want to filter by any other means. If the function returns a trully value, the subscriber gets invoked. The function gets the eventobject as its only argument and the context is the subscriber.

  • [prepend=false] Boolean optional

    whether the subscriber should be the first in the list of after-subscribers.

Returns:

Object:

handler with a detach()-method which can be used to detach the subscriber

selfOnceAfter

(
  • customEvent
  • callback
  • [filter]
  • [prepend=false]
)
Object

Defined in src/event/event-listener.js:212

Available since 0.0.1

Is automaticly available for Classes. Subscribes to a customEvent on behalf of the class-instance and will only be executed when the emitter is the instance itself.

The callback will be executed after the defaultFn. The subscriber will be automaticly removed once the callback executed the first time. No need to detach() (unless you want to undescribe before the first event)

Parameters:

  • customEvent String | Array

    the custom-event (or Array of events) to subscribe to. CustomEvents should have the syntax: emitterName:eventName. Wildcard * may be used for both emitterName as well as eventName. If emitterName is not defined, UI is assumed.

  • callback Function

    subscriber:will be invoked when the event occurs. An eventobject will be passed as its only argument.

  • [filter] String | Function optional

    to filter the event. Use a String if you want to filter DOM-events by a selector Use a function if you want to filter by any other means. If the function returns a trully value, the subscriber gets invoked. The function gets the eventobject as its only argument and the context is the subscriber.

  • [prepend=false] Boolean optional

    whether the subscriber should be the first in the list of after-subscribers.

Returns:

Object:

handler with a detach()-method which can be used to detach the subscriber

selfOnceBefore

(
  • customEvent
  • callback
  • [filter]
  • [prepend=false]
)
Object

Defined in src/event kopie/event-listener.js:240

Available since 0.0.1

Is automaticly available for Classes. Subscribes to a customEvent on behalf of the class-instance and will only be executed when the emitter is the instance itself.

The callback will be executed before the defaultFn. The subscriber will be automaticly removed once the callback executed the first time. No need to detach() (unless you want to undescribe before the first event)

Parameters:

  • customEvent String | Array

    the custom-event (or Array of events) to subscribe to. CustomEvents should have the syntax: emitterName:eventName. Wildcard * may be used for both emitterName as well as eventName. If emitterName is not defined, UI is assumed.

  • callback Function

    subscriber:will be invoked when the event occurs. An eventobject will be passed as its only argument.

  • [filter] String | Function optional

    to filter the event. Use a String if you want to filter DOM-events by a selector Use a function if you want to filter by any other means. If the function returns a trully value, the subscriber gets invoked. The function gets the eventobject as its only argument and the context is the subscriber.

  • [prepend=false] Boolean optional

    whether the subscriber should be the first in the list of before-subscribers.

Returns:

Object:

handler with a detach()-method which can be used to detach the subscriber

selfOnceBefore

(
  • customEvent
  • callback
  • [filter]
  • [prepend=false]
)
Object

Defined in src/event/event-listener.js:240

Available since 0.0.1

Is automaticly available for Classes. Subscribes to a customEvent on behalf of the class-instance and will only be executed when the emitter is the instance itself.

The callback will be executed before the defaultFn. The subscriber will be automaticly removed once the callback executed the first time. No need to detach() (unless you want to undescribe before the first event)

Parameters:

  • customEvent String | Array

    the custom-event (or Array of events) to subscribe to. CustomEvents should have the syntax: emitterName:eventName. Wildcard * may be used for both emitterName as well as eventName. If emitterName is not defined, UI is assumed.

  • callback Function

    subscriber:will be invoked when the event occurs. An eventobject will be passed as its only argument.

  • [filter] String | Function optional

    to filter the event. Use a String if you want to filter DOM-events by a selector Use a function if you want to filter by any other means. If the function returns a trully value, the subscriber gets invoked. The function gets the eventobject as its only argument and the context is the subscriber.

  • [prepend=false] Boolean optional

    whether the subscriber should be the first in the list of before-subscribers.

Returns:

Object:

handler with a detach()-method which can be used to detach the subscriber

selfOnceBefore

(
  • customEvent
  • callback
  • [filter]
  • [prepend=false]
)
Object

Defined in src/itsa-event/event-listener.js:240

Available since 0.0.1

Is automaticly available for Classes. Subscribes to a customEvent on behalf of the class-instance and will only be executed when the emitter is the instance itself.

The callback will be executed before the defaultFn. The subscriber will be automaticly removed once the callback executed the first time. No need to detach() (unless you want to undescribe before the first event)

Parameters:

  • customEvent String | Array

    the custom-event (or Array of events) to subscribe to. CustomEvents should have the syntax: emitterName:eventName. Wildcard * may be used for both emitterName as well as eventName. If emitterName is not defined, UI is assumed.

  • callback Function

    subscriber:will be invoked when the event occurs. An eventobject will be passed as its only argument.

  • [filter] String | Function optional

    to filter the event. Use a String if you want to filter DOM-events by a selector Use a function if you want to filter by any other means. If the function returns a trully value, the subscriber gets invoked. The function gets the eventobject as its only argument and the context is the subscriber.

  • [prepend=false] Boolean optional

    whether the subscriber should be the first in the list of before-subscribers.

Returns:

Object:

handler with a detach()-method which can be used to detach the subscriber