-
Notifications
You must be signed in to change notification settings - Fork 260
Expand file tree
/
Copy pathcallbacks.fired.xml
More file actions
30 lines (26 loc) · 904 Bytes
/
callbacks.fired.xml
File metadata and controls
30 lines (26 loc) · 904 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
<entry name="callbacks.fired" type="method" return="Boolean">
<signature>
<added>1.7</added>
</signature>
<desc>Determine if the callbacks have already been called at least once.</desc>
<longdesc>
<h2 id="example-1">Example</h2>
<p>Using <code>callbacks.fired()</code> to determine if the callbacks in a list have been called at least once:</p>
<pre>
// a sample logging function to be added to a callbacks list
var foo = function( value ){
console.log( 'foo:' + value );
}
var callbacks = $.Callbacks();
// add the function 'foo' to the list
callbacks.add( foo );
// fire the items on the list
callbacks.fire( 'hello' ); // outputs: 'foo: hello'
callbacks.fire( 'world '); // outputs: 'foo: world'
// test to establish if the callbacks have been called
console.log( callbacks.fired() );
</pre>
</longdesc>
<category slug="callbacks-object"/>
<category slug="version/1.7"/>
</entry>