npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

redux-saga-addons

v0.1.0

Published

Focused high-level helpers for Redux Saga.

Readme

redux-saga-addons

npm version npm downloads Bun CI license

Focused high-level helpers for Redux Saga.

The first helpers apply takeLatest and takeLeading independently to each key selected from an action or channel item. Work for different keys remains concurrent.

Installation

npm install redux-saga-addons redux-saga

Other package managers:

yarn add redux-saga-addons redux-saga
pnpm add redux-saga-addons redux-saga
bun add redux-saga-addons redux-saga

Usage

Latest task per key

import { call } from "redux-saga/effects";
import { takeLatestPerKey } from "redux-saga-addons";

function* fetchUser(action) {
  const user = yield call(api.fetchUser, action.payload.id);
  // ...
}

function* rootSaga() {
  yield takeLatestPerKey("FETCH_USER", fetchUser, (action) => action.payload.id);
}

If another FETCH_USER action arrives for the same ID, its previous worker is cancelled. Workers for other IDs continue running.

Leading task per key

import { takeLeadingPerKey } from "redux-saga-addons";

function* rootSaga() {
  yield takeLeadingPerKey("SAVE_USER", saveUser, (action) => action.payload.id);
}

While a worker is running, another matching item with the same key is ignored. Items with other keys still start their own workers.

API

takeLatestPerKey(patternOrChannel, worker, keySelector, ...args)

Returns a Redux Saga fork effect. The worker receives ...args followed by the matching action or channel item. A new item cancels the running worker selected by the same key before starting its replacement.

takeLeadingPerKey(patternOrChannel, worker, keySelector, ...args)

Returns a Redux Saga fork effect. The worker receives ...args followed by the matching action or channel item. A new item is ignored when a worker selected by the same key is already running.

Key selectors

keySelector must be synchronous and side-effect-free. It may return any non-thenable value; keys use JavaScript Map identity, so objects, symbols, strings, and numbers are all supported without string coercion.

An asynchronous selector is rejected. Resolve anything needed to choose the key before dispatching the action or writing the channel item.

Task lifecycle

  • Cancelling the watcher cancels its active workers.
  • Unhandled worker or selector errors propagate through normal attached Redux Saga task semantics.
  • Dispatching END, or closing an input channel, stops the watcher according to normal Redux Saga behavior.
  • Completed and cancelled tasks are removed from internal bookkeeping.

Runtime requirements

  • Redux Saga 1.5 or newer
  • An ESM-compatible runtime or bundler with native generator support

This package ships its source directly. It does not include generator runtime polyfills, transpilation helpers, or other compatibility shims. Applications are responsible for any compatibility support required by their target runtimes.

TypeScript declarations are included with the package.

Development

Run runtime and declaration tests:

bun run check

Inspect the package contents before publishing:

bun pm pack --dry-run

Background

The per-key helpers grew out of redux-saga/redux-saga#1744 and the earlier discussion in redux-saga/redux-saga#694. The original approach was proposed by @Andarist.

License

MIT