JSPM

redux-batched-subscribe

0.1.4
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 17057
  • Score
    100M100P100Q152390F
  • License MIT

redux store enhancer which allows batching subscribe notifications.

Package Exports

  • redux-batched-subscribe

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-batched-subscribe) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

redux-batched-subscribe

build status npm version

Store enhancer for redux which allows batching of subscribe notifications that occur as a result of dispatches.

npm install --save redux-batched-subscribe

Usage

Debounced subscribe handlers:

import { batchedSubscribe } from 'redux-batched-subscribe';
import debounce from 'lodash.debounce';

const batchDebounce = debounce(notify => notify());
const store = batchedSubscribe(batchDebounce)(createStore)(reducer, intialState);

React batched updates

import { batchedSubscribe } from 'redux-batched-subscribe';

// React <= 0.13
import { addons } from 'react/addons';
const batchedUpdates = addons.batchedUpdates;

// React 0.14-beta
import { unstable_batchedUpdates as batchedUpdates } from 'react-dom';

const store = batchedSubscribe(batchedUpdates)(createStore)(reducer, intialState);

This store enhancer also exposes a subscribeImmediate method which allows for unbatched subscribe notifications.

Thanks

Thanks to Andrew Clark for the clean library structure.