Skip to content

jvincent42/redux-throttle-actions

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

npm version david Build Status

redux-throttle-actions

A Redux middleware which throttles actions.

Usage

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.

License

MIT

About

A redux middleware which throttles actions

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 100.0%