Example 1 — true After lock()
Official style: lock the list, then call locked().
var foo = function (value) {
console.log("foo: " + value);
};
var callbacks = $.Callbacks();
callbacks.add(foo);
callbacks.fire("hello");
// foo: hello
callbacks.lock();
console.log(callbacks.locked()); // true How It Works
- Add and
fireso the list is active. - lock() freezes the current state.
- locked() reports
true.

