How to use the @cycle/isolate.default function in @cycle/isolate

To help you get started, we’ve selected a few @cycle/isolate examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github TylorS / cycle-snabbdom / test / browser / isolation.js View on Github external
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$
      }
    }
github TylorS / cycle-snabbdom / test / browser / isolation.js View on Github external
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$
      }
github TylorS / cycle-snabbdom / test / browser / isolation.js View on Github external
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$
      }
    }
github goodmind / cycle-telegram / lib / plugins.js View on Github external
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)); });

@cycle/isolate

A utility function to make scoped dataflow components in Cycle.js

MIT
Latest version published 5 years ago

Package Health Score

65 / 100
Full package analysis

Popular @cycle/isolate functions