How to use the @cycle/history.captureClicks function in @cycle/history

To help you get started, we’ve selected a few @cycle/history 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 usm4n / cycle-hn / src / index.ts View on Github external
driverFn = () => ({
    DOM: restartable(makeDOMDriver('#app'), {
        pauseSinksWhileReplaying: false
    }),
    HTTP: restartable(makeHTTPDriver()),
    Time: timeDriver,
    History: captureClicks(makeHistoryDriver())
});
/// #endif
github Blockstream / esplora / client / src / run-browser.js View on Github external
import { Observable as O } from './rxjs'

import main from './app'

const apiBase = (process.env.API_URL || '/api').replace(/\/+$/, '')
    , webBase = process.env.BASE_HREF || '/'
    , initTitle = process.browser ? document.title : process.env.SITE_TITLE

const titleDriver = title$ => O.from(title$)
  .subscribe(title => document.title = title ? `${title} · ${initTitle}` : initTitle)

run(main, {
  DOM: makeDOMDriver('#explorer')
, HTTP: makeHTTPDriver()
, route: makeRouteDriver(captureClicks(makeHistoryDriver({ basename: webBase })))
, storage: storageDriver
, search: makeSearchDriver(apiBase)
, title: titleDriver
, scanner: makeScanDriver()
})
github shesek / spark-wallet / client / src / app.js View on Github external
return {
    DOM:   vdom$
  , HTTP:  rpc.toHttp(serverInfo, rpc$)
  , route: navto$
  , conf$: state$.map(s => s.conf)
  , scan$: scanner$
  , orient$
  , notif$
  }
}

run(main, {
  DOM:   makeDOMDriver('#app')
, SSE:   makeSSEDriver(serverInfo)
, HTTP:  makeHTTPDriver()
, route: makeRouteDriver(captureClicks(makeHashHistoryDriver()))

, conf$:   makeConfDriver(storageDriver)
, orient$: orientDriver

, ...(
  process.env.BUILD_TARGET == 'cordova' ? {
    urihandler$: require('./driver/cordova-urihandler')
  , scan$: require('./driver/cordova-qrscanner')
  , notif$: require('./driver/cordova-notification')
  }

: process.env.BUILD_TARGET == 'electron' ? {
    urihandler$: require('./driver/electron-urihandler')
  , scan$: require('./driver/instascan')({ mirror: false, backgroundScan: false })
  , notif$: require('./driver/electron-notification')
  }

@cycle/history

The standard history driver for Cycle.js

MIT
Latest version published 3 years ago

Package Health Score

65 / 100
Full package analysis

Similar packages