How to use @cycle/html - 1 common examples

To help you get started, we’ve selected a few @cycle/html 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 Blockstream / esplora / client / src / run-server.js View on Github external
clearTimeout(timeout)
        timeout = setTimeout(_ => done({ errorCode: 504 }), LOAD_TIMEOUT)
      }
    }
    else if (seenLoading) done()
  }

  const historyDriver = goto$ => {
    O.from(goto$).subscribe(loc =>
      done({ redirect: loc.pathname + (loc.search || '') })
    )
    return O.of({ pathname, search: '?'+args, body })
  }

  const dispose = run(main, {
    DOM: makeHTMLDriver(htmlUpdate, { modules: ModulesForHTML })
  , HTTP: makeHTTPDriver()
  , route: makeRouteDriver(historyDriver)
  , storage: _ => ({ local: { getItem: key => O.of(locals[key]) } })
  , scanner: _ => O.empty()
  , search: makeSearchDriver(apiBase)
  , state: state$ => O.from(state$).subscribe(stateUpdate)
  })
}

@cycle/html

A driver for HTML strings based on Snabbdom and the DOM driver

MIT
Latest version published 4 years ago

Package Health Score

63 / 100
Full package analysis

Popular @cycle/html functions