Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function main (sources) {
const child = isolate(Child)(sources)
// make child.DOM be inserted, removed, and inserted again
const innerDOM$ = Observable.interval(50).take(3)
.map(x => x === 1 ? Observable.of(div()) : child.DOM).switch()
return {
DOM: innerDOM$
}
}
function main (sources) {
const first = isolate(Child, 'first')(sources)
first.DOM = first.DOM.share()
const second = isolate(Child, 'second')(sources)
second.DOM = second.DOM.share()
const oneChild = [first]
const twoChildren = [first, second]
const vnode$ = Observable.interval(50).skip(1).take(1).startWith(-1)
.map(i => i === -1 ? oneChild : twoChildren)
.map(children =>
Observable.combineLatest(
...children.map(child => child.DOM),
(...childVNodes) => div('.parent', childVNodes)
)
).switch()
return {
DOM: vnode$
}
function main (sources) {
const first = isolate(Child, 'first')(sources)
first.DOM = first.DOM.share()
const second = isolate(Child, 'second')(sources)
second.DOM = second.DOM.share()
const oneChild = [first]
const twoChildren = [first, second]
const vnode$ = Observable.interval(50).skip(1).take(1).startWith(-1)
.map(i => i === -1 ? oneChild : twoChildren)
.map(children =>
Observable.combineLatest(
...children.map(child => child.DOM),
(...childVNodes) => div('.parent', childVNodes)
)
).switch()
return {
DOM: vnode$
}
}
var toIsolate = ramda_1.curryN(3, function (update, sources, _a) {
var plugin = _a.plugin, props = _a.props;
return isolate_1.default(plugin.component)(ramda_1.merge({ props: props }, sources), update);
});
var isolatePlugin = ramda_1.curryN(4, function (update, sources, query, plugin) { return toIsolate(update, sources, toProps(query, plugin)); });