Skip to content

rn-libs/redux-debouncer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Redux debouncer

Install

yarn add redux-debouncer

How to use

import { makeReduxDebouncer } from 'redux-debouncer'

/**
 * type: string,
 * interval:? number,
 * compare:? (currentAction: any, prevAction: any) => bool,
 */
const incrementDebounce = makeReduxDebouncer({ type: 'increment' })

const middleware = [
  /* your middleware */
  incrementDebounce
]

Example

  // debouncer for react navigator
  export const reactNavigationDebounce = makeReduxDebouncer({
    type: 'Navigation/NAVIGATE',
    compare: (current, prev) => current.routeName === prev.routeName,
  })

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published