mirror of
https://github.com/flarum/core.git
synced 2025-06-06 06:35:09 +02:00
Ability to clear a retained subtree
This commit is contained in:
parent
0a2c05379c
commit
ebcf045ca1
@ -11,7 +11,7 @@
|
|||||||
*/
|
*/
|
||||||
export default class SubtreeRetainer {
|
export default class SubtreeRetainer {
|
||||||
constructor() {
|
constructor() {
|
||||||
this.old = [];
|
this.clear();
|
||||||
this.callbacks = [].slice.call(arguments);
|
this.callbacks = [].slice.call(arguments);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -30,4 +30,8 @@ export default class SubtreeRetainer {
|
|||||||
add() {
|
add() {
|
||||||
this.callbacks = this.callbacks.concat([].slice.call(arguments));
|
this.callbacks = this.callbacks.concat([].slice.call(arguments));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
clear() {
|
||||||
|
this.old = [];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user