static
Class Do
Allows for the insertion of methods that are executed before or after
a specified method
Properties
Contains the current state of the return value, consumable by
'after' event listeners, and updated if an after subscriber
changes the return value generated by the wrapped function.
Contains the return value from the wrapped method, accessible
by 'after' event listeners.
objs
- static object
Cache of objects touched by the utility
Methods
private
static
string
_inject
(
when
,
fn
,
obj
,
sFn
,
c
)
Execute the supplied method after the specified function
- Parameters:
-
when
<string>
before or after
-
fn
<Function>
the function to execute
-
obj
<object>
the object hosting the method to displace
-
sFn
<string>
the name of the method to displace
-
c
<object>
The execution context for fn
- Returns:
string
- handle for the subscription
static
string
after
(
fn
,
obj
,
sFn
,
c
,
arg*
)
Execute the supplied method after the specified function
- Parameters:
-
fn
<Function>
the function to execute
-
obj
<object>
the object hosting the method to displace
-
sFn
<string>
the name of the method to displace
-
c
<object>
The execution context for fn
-
arg*
<mixed>
0..n additional arguments to supply to the subscriber
- Returns:
string
- handle for the subscription
static
string
before
(
fn
,
obj
,
sFn
,
c
,
arg*
)
Execute the supplied method before the specified function
- Parameters:
-
fn
<Function>
the function to execute
-
obj
<object>
the object hosting the method to displace
-
sFn
<string>
the name of the method to displace
-
c
<object>
The execution context for fn
-
arg*
<mixed>
0..n additional arguments to supply to the subscriber
when the event fires.
- Returns:
string
- handle for the subscription
void
detach
(
handle
)
Detach a before or after subscription
- Parameters:
-
handle
<string>
the subscription handle