JSPM

redux-maybe

0.1.0
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • 0
  • Score
    100M100P100Q12406F
  • License MIT

Package for attaching callback functions to redux messages.

Package Exports

  • redux-maybe

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (redux-maybe) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

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