How to use the callbag-debounce.debounce function in callbag-debounce

To help you get started, we’ve selected a few callbag-debounce 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 htmlburger / carbon-fields / packages / core / hocs / with-validation / index.js View on Github external
filter( ( [ , visible ] ) => visible ),
				take( 1 ),
				map( ( [ value ] ) => ( {
					type: 'VALIDATE',
					payload: {
						value,
						transient: true
					}
				} ) )
			),

			pipe(
				value$,
				dropUntil( mount$ ),
				distinctUntilChanged(),
				debounce( 250 ),
				map( ( value ) => ( {
					type: 'VALIDATE',
					payload: {
						value,
						transient: false
					}
				} ) )
			),

			pipe(
				unmount$,
				map( () => ( {
					type: 'RESET'
				} ) )
			)
		);
github aaronshaf / react-callbag-subject / example / index.js View on Github external
const pipeline2 = actions =>
  pipe(
    actions,
    debounce(250),
    reducerFromMap(reducers2),
    startWith({ counter: 1 })
  );
github fanduel-oss / refract / examples / field-validation / callbag / src / index.js View on Github external
const aperture = ({ observe }) =>
    pipe(
        observe('username'),
        filter(Boolean),
        debounce(1000),
        map(username =>
            fromPromise(
                fetch(`https://api.github.com/users/${username}`).then(res =>
                    res.json()
                )
            )
        ),
        flatten,
        map(({ message }) => ({
            type: message === 'Not Found' ? 'USERNAME_AVAILABLE' : 'USER_FOUND'
        }))
    )
github fanduel-oss / refract / examples / debounced-fetch / callbag / src / index.js View on Github external
const aperture = ({ observe }) =>
    pipe(
        observe('username'),
        filter(Boolean),
        debounce(1000),
        map(username =>
            fromPromise(
                fetch(`https://api.github.com/users/${username}`).then(res =>
                    res.json()
                )
            )
        ),
        flatten,
        map(payload => ({ type: 'USER_DATA_RECEIVE', payload }))
    )
github fanduel-oss / refract / examples / typeahead / callbag / src / index.js View on Github external
map(({ items = [] }) => items.slice(0, 10)),
        map(suggestions => ({ suggestions })),
        map(toState)
    )

    const clearSuggestions$ = pipe(
        search$,
        filter(search => search === ''),
        map(() => ({ suggestions: [] })),
        map(toState)
    )

    const user$ = pipe(
        component.observe('selection'),
        filter(Boolean),
        debounce(200),
        map(selection =>
            fromPromise(
                fetch(`https://api.github.com/users/${selection}`).then(res =>
                    res.json()
                )
            )
        ),
        flatten,
        map(user => ({ user })),
        map(toState)
    )

    return merge(suggestions$, clearSuggestions$, user$)
}

callbag-debounce

debounce operator for callbag

MIT
Latest version published 3 years ago

Package Health Score

45 / 100
Full package analysis

Popular callbag-debounce functions