{"id":19773493,"url":"https://github.com/dmitryfillo/redux-saga-utils","last_synced_at":"2026-04-11T00:59:21.646Z","repository":{"id":57351493,"uuid":"84731355","full_name":"DmitryFillo/redux-saga-utils","owner":"DmitryFillo","description":"High level utils for redux-saga","archived":false,"fork":false,"pushed_at":"2017-03-26T20:11:08.000Z","size":103,"stargazers_count":0,"open_issues_count":6,"forks_count":3,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-02-12T04:12:05.801Z","etag":null,"topics":["react","react-redux","redux","redux-saga"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/redux-saga-utils","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/DmitryFillo.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-03-12T14:21:31.000Z","updated_at":"2017-03-26T18:46:36.000Z","dependencies_parsed_at":"2022-08-31T06:11:08.839Z","dependency_job_id":null,"html_url":"https://github.com/DmitryFillo/redux-saga-utils","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DmitryFillo%2Fredux-saga-utils","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DmitryFillo%2Fredux-saga-utils/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DmitryFillo%2Fredux-saga-utils/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DmitryFillo%2Fredux-saga-utils/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/DmitryFillo","download_url":"https://codeload.github.com/DmitryFillo/redux-saga-utils/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241104259,"owners_count":19910398,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["react","react-redux","redux","redux-saga"],"created_at":"2024-11-12T05:09:53.071Z","updated_at":"2025-12-31T01:10:19.469Z","avatar_url":"https://github.com/DmitryFillo.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"redux-saga-utils\n================\n\n[![image](https://img.shields.io/travis/DmitryFillo/redux-saga-utils/master.svg)](https://travis-ci.org/DmitryFillo/redux-saga-utils.svg?branch=master)\n[![image](https://img.shields.io/coveralls/DmitryFillo/redux-saga-utils/master.svg)](https://coveralls.io/github/DmitryFillo/redux-saga-utils?branch=master)\n\nHigh level utils for [redux-saga](https://github.com/redux-saga/redux-saga). These utils are based on the native [redux-saga](https://github.com/redux-saga/redux-saga) effects.\n\nInstallation\n------------\n\nVia [Yarn](https://yarnpkg.com/en/) (recommended):\n\n``` sourceCode\nyarn add redux-saga-utils\n```\n\nVia NPM:\n\n``` sourceCode\nnpm install redux-saga-utils --save\n```\n\nAPI Reference\n-------------\n\n### takeLatestParametric\n\n```js\ntakeLatestParametric(pattern, actionCompare, saga, ...args)\n```\n\nIt works like [takeLatest](https://github.com/redux-saga/redux-saga/tree/v0.14.3/docs/api#takelatestpattern-saga-args), but it checks action object before forking handler saga. Useful when you have actions with the same action type, but with different properties inside the action object to distinguish particular action scope. It's common approach in the redux world that helps to make redux apps reusable, e.g. [redux-form](http://redux-form.com/) uses that.\n\nSignature is a bit different from [takeLatest](https://github.com/redux-saga/redux-saga/tree/v0.14.3/docs/api#takelatestpattern-saga-args): `actionCompare` parameter is added. It's part of action object to compare with.\n\nImagine these action creators in the redux app:\n\n```js\nconst actionConst = 'EXAMPLE_ACTION';\n\nconst actionScopeOne = payload =\u003e ({\n  type: actionConst,\n  scope: 'scopeOne',\n  payload,\n});\n\nconst actionScopeTwo = payload =\u003e ({\n  type: actionConst,\n  scope: 'scopeTwo',\n  payload,\n});\n```\n\nThen you can catch only actions with particular scope properties in the sagas:\n\n```js\nimport { takeLatestParametric } from 'redux-saga-utils';\n\nconst worker = function* worker(action) {\n  // ...\n};\n\nconst saga = function* saga() {\n  yield takeLatestParametric(actionConst, { scope: 'scopeOne' }, worker),\n};\n```\n\n### awaitTransitiveActions\n\n```js\nawaitTransitiveActions(actions, awaitActions)\n```\n\n`actions` — array of actions. `awaitActions` — array of action constants.\n\nUseful when you want to wait for actions which will be produced by another actions. Such a case can occur in sagas that are waiting for page initialization, etc.\n\nImagine that you've these action creators:\n\n```js\nconst actionA = () =\u003e ({\n  type: 'ACTION_A',\n});\n\nconst actionB = () =\u003e ({\n  type: 'ACTION_B',\n});\n\nconst actionC = () =\u003e ({\n  type: 'ACTION_C',\n});\n\nconst actionD = () =\u003e ({\n  type: 'ACTION_D',\n});\n\nconst actionE = () =\u003e ({\n  type: 'ACTION_E',\n});\n```\n\nAnd a couple of sagas:\n\n```js\nconst sagaABC = function* sagaABC() {\n  yield take('ACTION_A');\n  // Do some I/O here.\n  yield put(actionB());\n  yield put(actionC());\n};\n\nconst sagaDE = function* sagaDE() {\n  yield take('ACTION_D');\n  yield put(actionE());\n};\n```\n\nYour `ACTION_A` will trigger `ACTION_B` and `ACTION_C` after I/O, as well as `ACTION_D` will trigger `ACTION_E`, *but before you can say knife*.\n\nYou can easily wait for all that stuff:\n\n```js\nimport { awaitTransitiveActions } from 'redux-saga-utils';\n\nconst saga = function* saga() {\n  yield awaitTransitiveActions([\n    actionA(),\n    actionD(),\n  ], [\n    'ACTION_E',\n    'ACTION_C',\n    'ACTION_B',\n  ]);\n  // ...\n};\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdmitryfillo%2Fredux-saga-utils","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdmitryfillo%2Fredux-saga-utils","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdmitryfillo%2Fredux-saga-utils/lists"}