Debounce middleware for the react-navigation redux actions
Switch branches/tags
Nothing to show
Clone or download
Andrey Korinskiy Andrey Korinskiy
Latest commit 378d241 Oct 15, 2017
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
dist
lib Only the same actions are debounced, SET_PARAMS is not debounced Oct 15, 2017
.DS_Store first commit Oct 4, 2017
.eslintrc first commit Oct 4, 2017
.gitignore first commit Oct 4, 2017
LICENSE
README.md
package.json Only the same actions are debounced, SET_PARAMS is not debounced Oct 15, 2017

README.md

React-Navigation Redux debouncer

This middleware resolves the common problem with React-Navigation - navigation action is called twice if you click fast enough the button that calls the navigation action. Just add this middleware and it will block all the Navigation actions during the predefined interval after some Navigation action already called.

Installation

npm install -s react-navigation-redux-debouncer

Usage

import navigationDebouncer from 'react-navigation-redux-debouncer';

const store = applyMiddleware( 
  navigationDebouncer( 600 ) // debounce time in ms, 600 by default if empty
)(createStore)(reducer);