{"id":15740130,"url":"https://github.com/cyrilluce/redux-saga-catch","last_synced_at":"2025-04-01T14:32:10.708Z","repository":{"id":86005218,"uuid":"95513829","full_name":"cyrilluce/redux-saga-catch","owner":"cyrilluce","description":"Helper for redux-saga, auto wrap saga with try-catch, prevent one throw stop all.","archived":true,"fork":false,"pushed_at":"2025-02-11T11:24:51.000Z","size":29,"stargazers_count":10,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-14T12:06:13.752Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","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/cyrilluce.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-06-27T03:29:29.000Z","updated_at":"2025-02-11T11:25:09.000Z","dependencies_parsed_at":"2023-05-09T15:24:06.083Z","dependency_job_id":null,"html_url":"https://github.com/cyrilluce/redux-saga-catch","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cyrilluce%2Fredux-saga-catch","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cyrilluce%2Fredux-saga-catch/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cyrilluce%2Fredux-saga-catch/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cyrilluce%2Fredux-saga-catch/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cyrilluce","download_url":"https://codeload.github.com/cyrilluce/redux-saga-catch/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246655058,"owners_count":20812576,"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":[],"created_at":"2024-10-04T02:11:56.291Z","updated_at":"2025-04-01T14:32:10.702Z","avatar_url":"https://github.com/cyrilluce.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003e [!IMPORTANT]\n\u003e This project is no longer maintained\n\n---\n\n# redux-saga-catch\nHelper for redux-saga, auto wrap saga with try-catch, prevent one throw stop all.\n\nredux-saga工具集，为了业务健壮，自动将saga进行try-catch包装，避免一个出错导致其它saga也出错中止。\n\n# usage\n## install\n```sh\nnpm i redux-saga-catch -S\n```\n\n## helpers with auto try-catch\n```js\nimport { takeEvery, takeLatest, throttle } from 'redux-saga-catch'\n\nfunction* rootSaga(){\n  yield takeEvery(ACTION1, function*(){\n    console.log('ACTION1 will always trigger')\n    throw 'exception'\n  })\n  // same as takeLatest、throttle\n}\n```\n\n## new helper `parallel` use to combine sagas with auto try-catch\n```js\nimport { parallel } from 'redux-saga-catch'\nfunction* rootSaga(){\n  yield parallel([\n    function*(){\n      throw 'exception'\n    },\n    function*(){\n      yield call(delay, 1000)\n      console.log('not affected')\n    }\n  ])\n}\n```\n\n## new helper `runAndTakeLatest` use to run task once before `takeLatest`, trigger will abort first running\n```js\nimport { runAndTakeLatest } from 'redux-saga-catch'\n\nfunction* saga(){\n  yield runAndTakeLatest(ACTION1, function*(){\n    console.log('Will run once without `ACTION1` fired.')\n  })\n}\n```\n\n## new helper `watchLatest` and `runAndWatchLatest` use to re-run only `selector` returns changed.\n```js\nimport { watchLatest } from 'redux-saga-catch'\n\nfunction* saga(){\n  yield watchLatest(ACTION1, globalState =\u003e globalState.data, function*(data){\n    console.log('Only run on `globalState.data` changed (use deep equal).')\n  })\n}\n```\n\n# Upgrade from 0.0.9\n1.x has added typescript support, if you are using 0.x, and meeting issue with typings check, you can overwrite `redux`'s `Action` interface\n```typescript\ndeclare module 'redux'{\n  interface Action{\n    type: any\n    payload?: any\n    [key: string]: any\n  }\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcyrilluce%2Fredux-saga-catch","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcyrilluce%2Fredux-saga-catch","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcyrilluce%2Fredux-saga-catch/lists"}