1.0.2 • Published 7 years ago

zaitun-effect v1.0.2

Weekly downloads
3
License
MIT
Repository
github
Last release
7 years ago

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();
                    }))
        );
    
}
1.0.2

7 years ago

1.0.1

7 years ago

1.0.0

7 years ago