https://github.com/pirosikick/redux-throttle-actions
A redux middleware which throttles actions
https://github.com/pirosikick/redux-throttle-actions
Last synced: about 2 months ago
JSON representation
A redux middleware which throttles actions
- Host: GitHub
- URL: https://github.com/pirosikick/redux-throttle-actions
- Owner: pirosikick
- Created: 2015-11-05T14:44:29.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2016-06-11T13:38:10.000Z (almost 9 years ago)
- Last Synced: 2025-04-03T21:39:37.746Z (about 2 months ago)
- Language: JavaScript
- Homepage:
- Size: 7.81 KB
- Stars: 6
- Watchers: 2
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
[](http://badge.fury.io/js/redux-throttle-actions)
[](https://david-dm.org/pirosikick/redux-throttle-actions)
[](https://travis-ci.org/pirosikick/redux-throttle-actions)redux-throttle-actions
======================A Redux middleware which throttles actions.
## Usage
```javascript
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);
```### `throttleActions(actionTypes, wait = 0, options = {})`
Returns a middleware function to be passed to `applyMiddleware`.
#### actionTypes
String or Array. Required.
A set of action types to be throttled.#### wait
The number of milliseconds to throttle actions to.
#### options
The options object for `_.throttle`.
See also [https://lodash.com/docs#throttle](https://lodash.com/docs#throttle).## License
[MIT](http://pirosikick.mit-license.org/)