Expose frptools utils: call and id

Makes subscribeToRender more tolerant of non-functions
This commit is contained in:
Timothy Farrell 2017-12-16 04:58:18 -06:00
parent 622cfaed91
commit f432d3b563
2 changed files with 3 additions and 2 deletions

View File

@ -16,7 +16,7 @@
"domvm": "~3.2.1", "domvm": "~3.2.1",
"exif-parser": "~0.1.9", "exif-parser": "~0.1.9",
"extract-text-webpack-plugin": "^3.0.2", "extract-text-webpack-plugin": "^3.0.2",
"frptools": "2.2.0", "frptools": "3.0.1",
"moment": "~2.19.3", "moment": "~2.19.3",
"pica": "~2.0.8", "pica": "~2.0.8",
"pouchdb-adapter-http": "~6.3.4", "pouchdb-adapter-http": "~6.3.4",

View File

@ -1,5 +1,6 @@
// export * from 'domvm/dist/dev/domvm.dev.js'; // export * from 'domvm/dist/dev/domvm.dev.js';
export * from 'domvm/dist/mini/domvm.mini.js'; export * from 'domvm/dist/mini/domvm.mini.js';
import { call } from 'frptools';
import { deepAssign } from './conversion.js'; import { deepAssign } from './conversion.js';
import { error } from '../services/console.js'; import { error } from '../services/console.js';
@ -7,7 +8,7 @@ export function subscribeToRender(vm, subscribables, subscriptions) {
const redraw = (...args) => vm.redraw(); const redraw = (...args) => vm.redraw();
const subList = subscribables.map(s => s.subscribe(redraw)).concat(subscriptions); const subList = subscribables.map(s => s.subscribe(redraw)).concat(subscriptions);
vm.config({ hooks: { willUnmount: () => subList.forEach(s => s()) } }); vm.config({ hooks: { willUnmount: () => subList.forEach(call) } });
} }
export function patchRefStyle(ref, style, evt, node, vm) { export function patchRefStyle(ref, style, evt, node, vm) {