How to use the callbag-basics.map function in callbag-basics

To help you get started, we’ve selected a few callbag-basics 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 fanduel-oss / refract / base / __tests__ / react / callbag / aperture.ts View on Github external
> = component =>
    pipe(
        component.observe(),
        map(({ prop }) => ({
            newProp: `${prop} world`
        })),
        map(asProps)
    )
github tryanzu / frontend / src / board / containers / chat.js View on Github external
function counters$(realtime, next) {
    return pipe(
        fromObs(channelToObs(realtime, 'chat:counters')),
        map(msg => msg.params),
        map(counters => ({
            ...counters,
            isOnline: new window.Map(counters.peers || []),
        })),
        subscribe({ next })
    );
}
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 langhuihui / rx4rx / perf / combine.js View on Github external
.add('cb-basics', function (deferred) {
        runners.runCallbag(deferred,
            callbag.pipe(
                callbag.combine(cbag1, cbag2, cbag3),
                callbag.map(add3Arr),
                callbag.filter(even)
            )
        );
    }, options)
    .add('xstream', function (deferred) {
github htmlburger / carbon-fields / packages / metaboxes / monitors / conditional-display / aperture / post-format.js View on Github external
addFilter( 'carbon-fields.conditional-display-post-format.classic', 'carbon-fields/metaboxes', () => {
	const node = document.querySelector( 'div#post-formats-select' );

	if ( ! node ) {
		return of( INITIAL_STATE );
	}

	return pipe(
		fromDelegatedEvent( node, 'input.post-format', 'change' ),
		map( ( { target } ) => getPostFormatFromRadioInput( target ) ),
		startWith( getPostFormatFromRadioInput( node.querySelector( 'input.post-format:checked' ) ) )
	);
} );

callbag-basics

Basic callbag factories and operators to get started with

MIT
Latest version published 3 years ago

Package Health Score

45 / 100
Full package analysis

Popular callbag-basics functions