Lazyify iterating subscriptions array un subscribeToRender

This allows the array to be manipulated between subscribeToRender call and view unmounting.
This commit is contained in:
Timothy Farrell 2017-12-17 21:52:52 -06:00
parent dc6aa41d0e
commit 26cd0660ed

View File

@ -6,9 +6,13 @@ import { error } from '../services/console.js';
export function subscribeToRender(vm, subscribables, subscriptions) {
const redraw = (...args) => vm.redraw();
const subList = subscribables.map(s => s.subscribe(redraw)).concat(subscriptions);
const subList = subscribables.map(s => s.subscribe(redraw));
vm.config({ hooks: { willUnmount: () => subList.forEach(call) } });
vm.config({
hooks: {
willUnmount: () => subList.concat(subscriptions).forEach(call)
}
});
}
export function patchRefStyle(ref, style, evt, node, vm) {