How to use the @cycle/time/rxjs.mockTimeSource function in @cycle/time

To help you get started, we’ve selected a few @cycle/time 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 MCS-Lite / mcs-lite / packages / mcs-lite-mobile-web / src / utils / helpers.js View on Github external
export function assertSourcesSinks(sources, sinks, main, done, timeOpts = {}) {
  const Time = mockTimeSource(timeOpts);
  const _sources = Object.keys(sources).reduce((_sources, sourceKey) => {
    const sourceObj = sources[sourceKey];
    const diagram = Object.keys(sourceObj)[0];
    const sourceOpts = sourceObj[diagram];

    let obj = {};
    let firstKey = Object.keys(sourceOpts)[0];
    if (typeof sourceOpts[firstKey] === 'function') {
      obj = {
        [sourceKey]: {
          // pass category to select
          [firstKey]: (...args) =>
            Time.diagram(diagram, sourceOpts[firstKey](...args)),
        },
      };
    } else {
github MCS-Lite / mcs-lite / packages / mcs-lite-admin-web / src / utils / helpers.js View on Github external
export function assertSourcesSinks(sources, sinks, main, done, timeOpts = {}) {
  const Time = mockTimeSource(timeOpts);
  const _sources = Object.keys(sources).reduce((_sources, sourceKey) => {
    const sourceObj = sources[sourceKey];
    const diagram = Object.keys(sourceObj)[0];
    const sourceOpts = sourceObj[diagram];

    let obj = {};
    let firstKey = Object.keys(sourceOpts)[0];
    if (typeof sourceOpts[firstKey] === 'function') {
      obj = {
        [sourceKey]: {
          // pass category to select
          [firstKey]: (...args) =>
            Time.diagram(diagram, sourceOpts[firstKey](...args)),
        },
      };
    } else if (firstKey === 'local') {

@cycle/time

A time driver designed to enable awesome testing and dev tooling

MIT
Latest version published 4 years ago

Package Health Score

59 / 100
Full package analysis