Ability to clear a retained subtree

This commit is contained in:
Toby Zerner 2015-05-04 10:43:40 +09:30
parent 0a2c05379c
commit ebcf045ca1

View File

@ -11,7 +11,7 @@
*/
export default class SubtreeRetainer {
constructor() {
this.old = [];
this.clear();
this.callbacks = [].slice.call(arguments);
}
@ -30,4 +30,8 @@ export default class SubtreeRetainer {
add() {
this.callbacks = this.callbacks.concat([].slice.call(arguments));
}
clear() {
this.old = [];
}
}