{"id":19201440,"url":"https://github.com/padcom/redux-action-reducer-mapper","last_synced_at":"2025-07-21T10:34:13.144Z","repository":{"id":42412405,"uuid":"62090612","full_name":"padcom/redux-action-reducer-mapper","owner":"padcom","description":"Easy creation of reducers for Redux","archived":false,"fork":false,"pushed_at":"2016-06-27T23:12:45.000Z","size":5,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-06-05T14:41:51.444Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/redux-action-reducer-mapper","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/padcom.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":"2016-06-27T21:47:38.000Z","updated_at":"2016-08-21T06:58:36.000Z","dependencies_parsed_at":"2022-09-26T20:31:20.688Z","dependency_job_id":null,"html_url":"https://github.com/padcom/redux-action-reducer-mapper","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/padcom/redux-action-reducer-mapper","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/padcom%2Fredux-action-reducer-mapper","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/padcom%2Fredux-action-reducer-mapper/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/padcom%2Fredux-action-reducer-mapper/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/padcom%2Fredux-action-reducer-mapper/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/padcom","download_url":"https://codeload.github.com/padcom/redux-action-reducer-mapper/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/padcom%2Fredux-action-reducer-mapper/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265386079,"owners_count":23756747,"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-09T12:38:47.482Z","updated_at":"2025-07-21T10:34:13.121Z","avatar_url":"https://github.com/padcom.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"A mapper that makes it easy to create reducers based on a set of closures mapped to actions.\n\nUse it instead of a gigantic and highly complex (in terms of cyclomatic code complexity) ```switch``` statement:\n\n```\nimport mapActionToReducer from 'redux-action-reducer-mapper';\n\nconst reducer = mapActionToReducer({\n  'default': '',\n  'MY_ACTION': (state, action) =\u003e action.payload\n})\n```\n\nis an equivalent of\n\n```\nconst reducer = (state = '', action) =\u003e {\n  switch(action.type) {\n    case 'MY_ACTION':\n      return action.payload;\n    default:\n      return state;\n  }\n}\n```\n\nThis reveals that if no action matched the previous state is returned.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpadcom%2Fredux-action-reducer-mapper","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpadcom%2Fredux-action-reducer-mapper","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpadcom%2Fredux-action-reducer-mapper/lists"}