zaitun-effect
TypeScript icon, indicating that this package has built-in type declarations

1.0.2 • Public • Published

zaitun-effect

rxjs middleware for zaitun

Install

npm install --save zaitun-effect

Uses

import {EffectManager, Effect} from 'zaitun-effect';

bootstrap({
    containerDom: '#app',    
    effectManager:EffectManager
});

function afterChildRender(dispatch: Dispatch, router: Router) {
    router
        .addEffect((eff:Effect) =>
            eff.whenAction(counter.actions.INCREMENT)
                .pipe(
                    mergeMap(action => {
                        dispatch({ type: INC_AT, payload: new Date().toString() });
                        return empty();
                    }))
        )
        .addEffect((eff:Effect) =>
            eff.whenAction(counter.actions.DECREMENT)
                .pipe(
                    mergeMap(action => {
                        dispatch({ type: DEC_AT, payload: new Date().toString() });
                        return empty();
                    }))
        );
    
}

Readme

Keywords

none

Package Sidebar

Install

npm i zaitun-effect

Weekly Downloads

0

Version

1.0.2

License

MIT

Unpacked Size

16.1 kB

Total Files

19

Last publish

Collaborators

  • jukhan