A Redux middleware which throttles actions.
import {createStore, applyMiddleware} from "redux";
import throttleActions from "redux-throttle-actions";
import reducers from "./reducers";
import actionTypes from "./constants/actionTypes";
const middleware = throttleActions([actionTypes.someAction], 500);
const store = applyMiddleware(middleware)(createStore)(reducers);
// In View
store.dispatch(action);
Returns a middleware function to be passed to applyMiddleware
.
String or Array. Required. A set of action types to be throttled.
The number of milliseconds to throttle actions to.
The options object for _.throttle
.
See also https://lodash.com/docs#throttle.