offInstanceBoundChange
Stop listening to when observables of a type are bound and unbound.
offInstanceBoundChange(Type, handler, [queueName])
Unregister an event handler from the type Type that had previously been registered with
onInstanceBoundChange. The function passed as handler will no longer be called
when instances of Type gains its first or loses its last binding.
Person = DefineMap.extend({ ... });
var person = Person({});
var handler = function(instance, newVal) {
console.log(instance, "bound state is now", newVal);
};
var keyHandler = function() {};
canReflect.onInstanceBoundChange(Person, handler);
canReflect.offInstanceBoundChange(Person, handler);
canReflect.onKeyValue(obj, "name", keyHandler); // nothing is logged
canReflect.offKeyValue(obj, "name", keyHandler); // nothing is logged
Parameters
- Type
{function}:A constructor function
- handler
{function(instance, isBound)}:The
handlerpassed tocanReflect.onInstanceBoundChange. - queueName
{String}:the name of the queue in can-queues the handler was registered under