redux-saga-debounced-channel

Debounced channel for Redux Saga

Usage no npm install needed!

<script type="module">
  import reduxSagaDebouncedChannel from 'https://cdn.skypack.dev/redux-saga-debounced-channel';
</script>

README

redux-saga-debounced-channel

Installation & Usage

npm install --save redux-saga-debounced-channel

Also install peerDependencies (if not already installed)

npm install --save redux-saga

Summary

A saga to get a debounced value from a channel without cancelling the previous taken item's task. This is useful for when you need to incrementally save progress or updates (ie autosave).

Usage

getDebouncedValueFromChannel

A saga that returns the last item on the channel after a specified delay.

getDebouncedValueFromChannel<T = AnyAction>(
  actionChannel: Channel<T>,
  delayInMs: number,
): SagaIterator

actionChannel

A redux-saga channel configured to receive the actions that need to be debounced

delayInMs

The amount of milliseconds to debounce by

Local Development

Below is a list of commands you will probably find useful.

npm start or yarn start

Runs the project in development/watch mode. Your project will be rebuilt upon changes. Error messages are pretty printed and formatted for compatibility VS Code's Problems tab.

Your library will be rebuilt if you make edits.

npm run build or yarn build

Bundles the package to the dist folder. The package is optimized and bundled with Rollup into multiple formats (CommonJS, UMD, and ES Module).

npm test or yarn test

Runs the test watcher (Jest) in an interactive mode. By default, runs tests related to files changed since the last commit.