Skip to content

Nodejs Package for attaching callback functions to redux messages.

License

Notifications You must be signed in to change notification settings

garblovians/redux-maybe

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

redux-maybe

Node.js Package for attaching callback functions to redux messages.

redux-maybe is using redux-observable to attach callbacks. It's basically an epic which listens for the "CALL_ME_MAYBE" action including a actiontype to listen for, a callback and a number of times to repeat the callback.

The name is designed to make Carly Rae Jepsens' hit song start playing in your brain everytime you use the package.

Getting Started

Before you start using this package, you are advised to know you way around both redux and redux-observables.

Installing

To install the package

npm install --save redux-maybe

Usage

import { myReducers }             from './myReducers';
import { createStore }            from 'redux';
import { createEpicMiddleware }   from 'redux-observable';
import { maybeEpic, callMeMaybe } from 'redux-maybe';

//Import RXJS in order to make redux-observable happy
import 'rxjs';

const epicMiddleware = createEpicMiddleware(maybeEpic);

const store = createStore(myReducers,applyMiddleware(epicMiddleware));

store.dispatch(callMeMaybe("TEST_ACTION", () => console.log("CALLED_MAYBE"),1));
store.dispatch({type:"TEST_ACTION"});
CALLED_MAYBE

License

This project is licensed under the MIT License - see the LICENSE file for details

About

Nodejs Package for attaching callback functions to redux messages.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages