概述 callbacks.fired()
返回值:Boolean
描述:确定回调是否至少已经调用一次。
示例
使用callbacks.fired() 确定,如果列表中的回调至少有一次被呼叫
// 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() );