1 line
892 B
JSON
1 line
892 B
JSON
{"name":"callbacks.locked","type":"method","title":"callbacks.locked()","deprecated":null,"removed":null,"desc":"Determine if the callbacks list has been locked.","categories":["callbacks-object","version/1.7"],"entries":[{"return":"Boolean","signatures":{"added":"1.7"},"examples":{"desc":"Use <code>callbacks.locked()</code> to determine the lock-state of a callback list:","code":"\n// A sample logging function to be added to a callbacks list\nvar foo = function( value ) {\n console.log( \"foo: \" + value );\n};\n\nvar callbacks = $.Callbacks();\n\n// Add the logging function to the callback list\ncallbacks.add( foo );\n\n// Fire the items on the list, passing an argument\ncallbacks.fire( \"hello\" );\n// Outputs \"foo: hello\"\n\n// Lock the callbacks list\ncallbacks.lock();\n\n// Test the lock-state of the list\nconsole.log ( callbacks.locked() );\n// true\n"},"longdesc":""}]} |