{"id":19903875,"url":"https://github.com/zerotohero-dev/swop","last_synced_at":"2026-06-10T00:31:17.151Z","repository":{"id":57155973,"uuid":"123532262","full_name":"zerotohero-dev/swop","owner":"zerotohero-dev","description":"intelligently creates higher-order reducers that switch on action types","archived":false,"fork":false,"pushed_at":"2018-03-09T21:36:47.000Z","size":607,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-13T13:05:19.693Z","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/zerotohero-dev.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":"2018-03-02T04:57:25.000Z","updated_at":"2023-10-02T22:23:10.000Z","dependencies_parsed_at":"2022-08-28T05:50:11.560Z","dependency_job_id":null,"html_url":"https://github.com/zerotohero-dev/swop","commit_stats":null,"previous_names":["jsbites/swop"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zerotohero-dev%2Fswop","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zerotohero-dev%2Fswop/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zerotohero-dev%2Fswop/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zerotohero-dev%2Fswop/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zerotohero-dev","download_url":"https://codeload.github.com/zerotohero-dev/swop/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241331183,"owners_count":19945313,"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-11-12T20:25:48.622Z","updated_at":"2026-06-10T00:31:17.121Z","avatar_url":"https://github.com/zerotohero-dev.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"I will add more, but just as a quick usage example.\r\n\r\nAssume you have actions `ADD_TO_DO`, `REMOVE_TO_DO`, and reducers `addToDo` and `removeToDo`.\r\n\r\nThen…\r\n\r\n```javascript\r\nimport swop from 'swop';\r\n\r\n// constants and reducers are defined here.\r\n\r\n// Export a higher-order reducer that switches to the reducer that the action maps to \r\n// or defaults to an identity reducer if there’s not matching action.\r\nexport default swop({\r\n  [ADD_TO_DO]: addToDo,\r\n  [REMOVE_TO_DO]: removeToDo\r\n});\r\n```\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzerotohero-dev%2Fswop","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzerotohero-dev%2Fswop","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzerotohero-dev%2Fswop/lists"}