How to use the @cycle/rxjs-run.run function in @cycle/rxjs-run

To help you get started, we’ve selected a few @cycle/rxjs-run 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 staltz / rxmarbles / src / app.js View on Github external
const sinks = {
    DOM: appView(sandbox.DOM),
    store: Observable.merge(route$, sandbox.data)
      .scan(merge, {}),
  };

  return sinks;
}

// Note: drivers use xstream 
function dummyDriver(initialValue) {
  return (value$) => value$.remember().startWith(initialValue);
}

run(main, {
  DOM: makeDOMDriver('#app-container'),
  store: dummyDriver({}),
});
github MCS-Lite / mcs-lite / packages / mcs-lite-admin-web / src / store / configureStore.js View on Github external
*/
  if (process.env.NODE_ENV !== 'production') {
    middlewares.push(require('redux-freeze')); // eslint-disable-line global-require
  }

  const store = createStore(
    reducer,
    initialState,
    composeEnhancers(applyMiddleware(...middlewares)),
  );

  /**
   * redux-cycles
   * Remind: MUST create sotre first.
   */
  run(main, {
    ACTION: makeActionDriver(),
    STATE: makeStateDriver(),
    Time: timeDriver,
    HTTP: makeHTTPDriver(),
    STORAGE: storageDriver,
  });

  return store;
};
github staltz / cycle-onionify / test-with-rxjs.js View on Github external
function main(sources) {
    const List = makeCollection({
      item: child,
      collectSinks: instances => ({
        onion: instances.pickMerge('onion')
      }),
    });
    const obs = List(sources).onion;
    t.is(typeof obs.switchMap, 'function');
    return {
      onion: Observable.never(),
    };
  }

  run(onionify(main), {dummy: () => {}});
});
github axisgroup / RxQ / examples / cycle-basic / src / main.js View on Github external
}));

    appList$.subscribe(s => console.log(`Search Term: \'${s.filter}\' | Filtered Doc List: `, s.list));

    const vdom$ = appList$.map(m => div('.container', [
        input('.input'),
        ul('.application-list', { style: { 'list-style-type': 'none', 'padding': '0px' } },
            m.list.map(n => li('.application-list-item', n.qDocName)))
    ]));

    return {
        DOM: vdom$
    };
}

run(main, {
    DOM: makeDOMDriver('#app-container'),
});
github axisgroup / RxQ / examples / cycle-combined / src / main.js View on Github external
appList$.subscribe(s => console.log(`Search Term: \'${s.filter}\' | Filtered Doc List: `, s.list));

    const vdom$ = appList$.map(m => div('.container', [
        input('.input', { attr: { 'placeholder': 'Filter' } }),
        ul('.application-list', { style: { 'list-style-type': 'none', 'padding': '0px' } },
            m.list.map(n => li('.application-list-item', [
                div(n.qDocName + ` (${n.server})`)
            ])))
    ]));

    return {
        DOM: vdom$
    };
}

run(main, {
    DOM: makeDOMDriver('#app-container'),
});
github brucou / cycle-state-machine-demo / src / index.js View on Github external
.then(() => {
    run(App, drivers);
  })
  .catch(function (err) {
github cyclejs-community / cyclejs-sortable / examples / horizontal / src / index.ts View on Github external
ul([
            li(['Option 1']),
            li(['Option 2']),
            li(['Option 3']),
            li(['Option 4']),
            li(['Option 5']),
            li(['Option 6'])
        ])
    );

    return {
        DOM: vdom$
    };
}

run(main, {
    DOM: makeDOMDriver('#app'),
    drag: userSelectDriver
});
github cyclejs-community / cyclejs-modal / examples / rxjs / src / index.ts View on Github external
function modal({ DOM }: Sources): Sinks {
    return {
        DOM: observableOf(
            div('.div', [
                span('.span', ['This is an rxjs modal! :)']),
                button('.button', ['close'])
            ])
        ),
        modal: DOM.select('.button')
            .events('click')
            .pipe(mapTo({ type: 'close' } as ModalAction))
    };
}

run(modalify(main), {
    DOM: makeDOMDriver('#app')
});
github cyclejs-community / cyclejs-sortable / docs / examples / horizontal / src / index.ts View on Github external
li('.li', '', ['Option 5']),
                li('.li', '', ['Option 6'])
            ])
        ])
    ).let(
        makeSortable>(DOM, {
            parentSelector: '.ul'
        })
    );

    return {
        DOM: vdom$
    };
}

run(main, {
    DOM: makeDOMDriver('#app')
});
github cyclejs / cyclejs / examples / basic / bmi-naive / src / main.js View on Github external
div([
         'Height ' + height + 'cm',
         input('#height', {
           attrs: {type: 'range', min: 140, max: 210, value: height}
         })
       ]),
       h2('BMI is ' + bmi)
     ])
  );

  return {
    DOM: vdom$,
  };
}

run(main, {
  DOM: makeDOMDriver('#main-container')
});

@cycle/rxjs-run

The Cycle run() function meant to be used with RxJS v5

MIT
Latest version published 5 years ago

Package Health Score

63 / 100
Full package analysis

Popular @cycle/rxjs-run functions