Feature: You can register objects on instantiation now
No need for calling the register method afterwards anymore. Pass an array or a single object
This commit is contained in:
parent
ab20281c58
commit
b01f919b9a
@ -587,6 +587,15 @@
|
||||
if (attr && attr.track) {
|
||||
this.startTracking();
|
||||
}
|
||||
|
||||
// Register objects passed in the "register" attribute
|
||||
if (attr && attr.register) {
|
||||
if (_.isArray(attr.register) || _.isArguments(attr.register)) {
|
||||
apply(this.register, this, attr.register);
|
||||
} else {
|
||||
this.register(attr.register);
|
||||
}
|
||||
}
|
||||
},
|
||||
/**
|
||||
* Starts tracking. Changes of registered objects won't be processed until you've called this function
|
||||
|
Loading…
Reference in New Issue
Block a user