Namespace: function

me.utils. function

a collection of utility functions
Source:
function.js, line 9

Methods

<static> defer(fn, scope) → {Number}

Executes a function as soon as the interpreter is idle (stack empty).
Parameters:
Name Type Argument Description
fn function The function to be deferred.
scope Object The execution scope of the deferred function.
arguments... <optional>
Optional additional arguments to carry for the function.
Source:
function.js, line 18
Returns:
id that can be used to clear the deferred function using clearTimeout
Type
Number
Example
// execute myFunc() when the stack is empty,
// with the current context and 'myArgument' as parameter
me.utils.function.defer(fn, this, 'myArgument');

<static> throttle(fn, delay, no_trailing)

returns a function that, when invoked will only be triggered at most once during a given window of time
Parameters:
Name Type Description
fn function the function to be throttled.
delay Number The delay in ms
no_trailing no_trailing disable the execution on the trailing edge
Source:
function.js, line 40