mirror of
https://github.com/flarum/framework.git
synced 2025-05-28 19:06:35 +08:00
Ability to clear a retained subtree
This commit is contained in:
@ -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 = [];
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user