redux-batched-subscribe alternatives and similar libraries
Based on the "Data Store" category.
Alternatively, view redux-batched-subscribe alternatives based on common mentions on social networks and blogs.
-
recompose
A React utility belt for function components and higher-order components. -
mobx-react
React bindings for MobX. Create fully reactive components. -
reflux
A simple library for uni-directional dataflow application architecture with React extensions inspired by Flux -
fluxible
A pluggable container for universal flux applications. -
cerebral
Declarative state and side effects management for popular JavaScript frameworks -
fluxxor
:hammer_and_wrench: Flux architecture tools for React -
redux-batched-actions
redux higher order reducer + action to reduce actions under a single subscriber notification -
shasta
Dead simple + opinionated toolkit for building redux/react applications -
react-i13n
A performant, scalable and pluggable approach to instrumenting your React application. -
fluorine-lib
Reactive state and side effect management for React using a single stream of actions. -
react-controllables
Easily create controllable components -
react-redux-provide
Bridges the gap between Redux and the declarative nature of GraphQL/Relay. Share, manipulate, and replicate application state across any number of components. -
fireproof
Realtime database, runs anywhere. Install Fireproof in your front-end app or edge function, and sync data via any backend. -
resourcerer
Declarative data-fetching and caching framework for REST APIs with React -
react-3ducks
Simple state management solution for React -
synergies
Create a performant distributed context state for React by composing reusable state logic.
SurveyJS - Open-Source JSON Form Builder to Create Dynamic Forms Right in Your App
Do you think we are missing an alternative of redux-batched-subscribe or a related project?
README
redux-batched-subscribe
Store enhancer for redux which allows batching of subscribe notifications that occur as a result of dispatches.
npm install --save redux-batched-subscribe
Usage
The batchedSubscribe
store enhancer accepts a function which is called after every dispatch with a notify
callback as a single argument. Calling the notify
callback will trigger all the subscription handlers, this gives you the ability to use various techniques to delay subscription notifications such as: debouncing, React batched updates or requestAnimationFrame.
Since batchedSubscribe
overloads the dispatch and subscribe handlers on the original redux store it is important that it gets applied before any other store enhancers or middleware that depend on these functions; The compose utility in redux can be used to handle this:
import { createStore, applyMiddleware, compose } from 'redux';
import { batchedSubscribe } from 'redux-batched-subscribe';
const enhancer = compose(
applyMiddleware(...middleware),
batchedSubscribe((notify) => {
notify();
})
)
// Note: passing enhancer as the last argument to createStore requires redux@>=3.1.0
const store = createStore(reducer, initialState, enhancer);
Note: since compose
applies functions from right to left, batchedSubscribe
should appear at the end of the chain.
The store enhancer also exposes a subscribeImmediate
method which allows for unbatched subscribe notifications.
Examples
Debounced subscribe handlers:
import { createStore } from 'redux';
import { batchedSubscribe } from 'redux-batched-subscribe';
import debounce from 'lodash.debounce';
const debounceNotify = debounce(notify => notify());
// Note: passing batchedSubscribe as the last argument to createStore requires redux@>=3.1.0
const store = createStore(reducer, intialState, batchedSubscribe(debounceNotify));
React batched updates
import { createStore } from 'redux';
import { batchedSubscribe } from 'redux-batched-subscribe';
// React >= 0.14
import { unstable_batchedUpdates } from 'react-dom';
// Note: passing batchedSubscribe as the last argument to createStore requires redux@>=3.1.0
const store = createStore(reducer, intialState, batchedSubscribe(unstable_batchedUpdates));
Thanks
Thanks to Andrew Clark for the clean library structure.