redux-skip-by-action

0.1.1 • Public • Published

This repository is not considered best practices for Redux - for a more appropriate solution to the problem, see redux-batched-actions

redux-skip-by-action

Store enhancer for redux that enables skipping subscriber notifications for individual actions.

npm install --save redux-skip-by-action

Usage

import {createStore, compose} from 'redux';
import skipByAction, {skip} from 'redux-skip-by-action';
 
const store = compose(skipByAction)(createStore)(reducer, intialState);
 
// note: skip adds FSA-compliant metadata to the action
store.dispatch(skip({type: SOME_ACTION, payload: somePayload}))
 
// the above is equivalent to
store.dispatch({type: SOME_ACTION, payload: somePayload, meta: {skip: true}})

Thanks

Thanks to Terry Appleby for redux-batched-subscribe.

Package Sidebar

Install

npm i redux-skip-by-action

Weekly Downloads

1

Version

0.1.1

License

MIT

Last publish

Collaborators

  • tshelburne