once - Methods - Annotations API

Annotations API Methods

once()

Just like on(), but causes the bound callback to only fire once before being removed. Handy for saying "the next time that X happens, do this only once".

Examples

itemsApp.assessApp().annotationsApp().once('texthighlight:add', function () {
  // onTextHighlight callback
});

Arguments

  • eventName string

    The name of the event that the callback will be bound to.

  • callback function

    The function that will be invoked when the specified event is triggered.

  • context object

    The context for which the callback should be invoked.

Return value

None (undefined).

Was this article helpful?

Did you arrive here by accident? If so, learn more about Learnosity.