mirror of
https://github.com/flarum/core.git
synced 2025-08-11 10:55:47 +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
|
||||
* 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 {
|
||||
/**
|
||||
@@ -32,7 +32,7 @@ export default class SubtreeRetainer {
|
||||
* @return {Object|false}
|
||||
* @public
|
||||
*/
|
||||
retain() {
|
||||
needsRebuild() {
|
||||
let needsRebuild = false;
|
||||
|
||||
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