1.1.4. Function box.once¶
once(key, function[, ...])¶
Execute a function, provided it has not been executed before. A passed value is checked to see whether the function has already been executed. If it has been executed before, nothing happens. If it has not been executed before, the function is invoked. For an explanation why
box.onceis useful, see the section Preventing Duplicate Actions.
- key (string) – a value that will be checked
- function (function) – a function
- ... – arguments, that must be passed to function