mirror of
https://github.com/flarum/core.git
synced 2025-08-11 19:04:29 +02:00
infrastructure: For SubtreeRetainer, return a boolean, not a vnode, as subtree retaining is now managed by onbeforeupdate
This commit is contained in:
committed by
Franz Liedke
parent
29af3e6d8b
commit
9793c10610
@@ -14,7 +14,7 @@
|
|||||||
* // view
|
* // view
|
||||||
* this.subtree.retain() || 'expensive expression'
|
* this.subtree.retain() || 'expensive expression'
|
||||||
*
|
*
|
||||||
* @see https://lhorie.github.io/mithril/mithril.html#persisting-dom-elements-across-route-changes
|
* @see https://mithril.js.org/lifecycle-methods.html#onbeforeupdate
|
||||||
*/
|
*/
|
||||||
export default class SubtreeRetainer {
|
export default class SubtreeRetainer {
|
||||||
/**
|
/**
|
||||||
@@ -32,7 +32,7 @@ export default class SubtreeRetainer {
|
|||||||
* @return {Object|false}
|
* @return {Object|false}
|
||||||
* @public
|
* @public
|
||||||
*/
|
*/
|
||||||
retain() {
|
needsRebuild() {
|
||||||
let needsRebuild = false;
|
let needsRebuild = false;
|
||||||
|
|
||||||
this.callbacks.forEach((callback, i) => {
|
this.callbacks.forEach((callback, i) => {
|
||||||
@@ -44,7 +44,7 @@ export default class SubtreeRetainer {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
return needsRebuild ? false : { subtree: 'retain' };
|
return needsRebuild;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Reference in New Issue
Block a user