{"id":22342685,"url":"https://github.com/aircloud/redux-saga-beginner","last_synced_at":"2026-06-28T16:31:05.995Z","repository":{"id":95590511,"uuid":"103115713","full_name":"aircloud/redux-saga-beginner","owner":"aircloud","description":"a demo for redux-saga for beginners","archived":false,"fork":false,"pushed_at":"2017-09-11T13:53:02.000Z","size":14,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-08-09T23:52:15.465Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/aircloud.png","metadata":{"files":{"readme":"README-private.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-09-11T09:20:03.000Z","updated_at":"2019-06-13T07:26:54.000Z","dependencies_parsed_at":"2023-04-20T00:16:51.504Z","dependency_job_id":null,"html_url":"https://github.com/aircloud/redux-saga-beginner","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/aircloud/redux-saga-beginner","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aircloud%2Fredux-saga-beginner","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aircloud%2Fredux-saga-beginner/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aircloud%2Fredux-saga-beginner/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aircloud%2Fredux-saga-beginner/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/aircloud","download_url":"https://codeload.github.com/aircloud/redux-saga-beginner/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aircloud%2Fredux-saga-beginner/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34896652,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-28T02:00:05.809Z","response_time":54,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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-12-04T08:13:24.022Z","updated_at":"2026-06-28T16:31:05.990Z","avatar_url":"https://github.com/aircloud.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n\u003e这里记录一些自己对saga的使用的感受\n\n感觉saga为了方便测试，还是做了不少工作，比如让yield之后的内容都返回一个文本化的对象，可以直接用deepequal之类的方法来进行测试。\n\n另外saga基于generator的写法，也对错误的捕获和处理非常友好。\n\n### 什么时候该使用saga呢？\n\n对于这个问题，我认为saga在以下几种场景比较有优势：\n\n* 网络请求较多，并且请求互相依赖，或者请求之间有竞速关系，这个时候使用thunk等中间件会产生比较多的冗余代码\n* 有持续性用户交互的场景，比如用户使用搜索框进行搜索并实时展示搜索结果，或者在线文档编辑的场景\n* 流程性较强的逻辑，比如用户第一步做什么、第二步做什么、第三步做什么都已经被规定好的情况下\n* 另外在一些其他的想要优雅的情况,","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faircloud%2Fredux-saga-beginner","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faircloud%2Fredux-saga-beginner","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faircloud%2Fredux-saga-beginner/lists"}