Releases: canjs/can-reflect
Releases · canjs/can-reflect
canReflect.hasKey
1.12.0
Implements onInstancePatches / offInstancePatches
This release includes the base implementation of onInstancePatches
/ offInstancePatches
which allow users to register / unregister a callback to fire when anything changes on any instance of the type passed in as an argument.
var Person = DefineMap.extend({});
canReflect.onInstancePatches(
Person,
// This function is called when any instance of the Person type changes
function(instances, patches) {
}
);
Fixes bug with updating deep lists
1.11.0
Performance improvements
This speeds up .isObservable()
and make it true if can.onPatches
is present.
Fixes tests to work in IE
v1.8.2 1.8.2
Objects with Array.prototype on their proto chain are isMoreListLikeThanMapLike
var MyArray = function(values) {
this.push.apply(this, values);
};
MyArray.prototype = Object.create(Array.prototype);
MyArray.prototype.constructor = MyArray;
var arr = new MyArray();
typeReflections.isMoreListLikeThanMapLike(arr) //-> true
onInstanceBoundChange, defineInstanceKey, onInstancePatches, onPatches
From #77
defineInstanceKey(Type, key, descriptor)
- define a key behavior on instances of a typeonInstanceBoundChange(Type, handler(instance, isBound) )
- listen to when instances of this type are bound or unboundonInstancePatches(Type, handler(instance, patches) )
- listen to the patches events of all instances of this typeonPatches(obj, handler(patches))
- listen to patch events on this type
Update docs with new @parent & @collection
Release to re-include test folder
This was due to an npm bug