How to use the @most/scheduler.newDefaultScheduler function in @most/scheduler

To help you get started, we’ve selected a few @most/scheduler 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 mostjs / core / examples / counter / src / index.js View on Github external
import { newDefaultScheduler } from '@most/scheduler'
import { click } from '@most/dom-event'
import { qs } from '../../common'

const incButton = qs('[name=inc]', document)
const decButton = qs('[name=dec]', document)
const value = qs('.value', document)

const inc = constant(1, click(incButton))
const dec = constant(-1, click(decButton))

const counter = scan((total, delta) => total + delta, 0, merge(inc, dec))

const render = tap(total => { value.innerText = String(total) }, counter)

runEffects(render, newDefaultScheduler())
github mostjs / core / packages / core / src / scheduler / defaultScheduler.js View on Github external
/** @license MIT License (c) copyright 2010-2016 original author or authors */
/** @author Brian Cavalier */
/** @author John Hann */

import { newDefaultScheduler } from '@most/scheduler'

var defaultScheduler = newDefaultScheduler()

export default defaultScheduler

@most/scheduler

Reactive programming with lean, functions-only, curried, tree-shakeable API

MIT
Latest version published 4 years ago

Package Health Score

61 / 100
Full package analysis