DiviArea.addActionOnce()

  1. Home
  2. Knowledge Base
  3. Codex
  4. JS API
  5. JS Functions
  6. DiviArea.addActionOnce()
DiviArea.addActionOnce(hook, callback, priority, context)

// Alias:
DiviArea.Hooks.addActionOnce(hook, callback, priority, context)

Same as addAction() but the callback is unhooked again when the action is called the next time. This function ensures, that the callback is only invoked once.

Params

hook
(string, required) The hook name.
callback
(function, required) The callback function.
priority
(int, optional) Hook priority.
Default: 10
context
(object, optional) The callback context.
Default: window

Returns

The function does not return anything.

Notes

No notes

Was this article helpful?

Related Articles