redux-debounce-thunk

1.0.1 • Public • Published

Make debounced action creator

You want to use this package to create a debounced version of a redux action creator. Example use cases:

  1. send ajax call after a user stops changing search query
  2. I don't know. PRs are welcome.

Installation

npm i redux-debounce-thunk
 
# or with yarn 
 
yarn add redux-debounce-thunk

Notice: this requires redux and redux-thunk (of course).

Usage

import makeDebounce from 'redux-debounce-thunk'
 
const actionCreator = /* some action creator */;
 
const debouncedActionCreator = makeDebounce(actionCreator, 300); // debounce 300ms
 
// simply dispatch the action
store.dispatch(debouncedActionCreator(anyParams, anotherOne));

Why another redux-debounce-xxx

Because I don't want meta and another middleware.

/redux-debounce-thunk/

    Package Sidebar

    Install

    npm i redux-debounce-thunk

    Weekly Downloads

    118

    Version

    1.0.1

    License

    ISC

    Unpacked Size

    3.94 kB

    Total Files

    5

    Last publish

    Collaborators

    • tungv