{"id":21004822,"url":"https://github.com/halfzebra/algebraic-actions","last_synced_at":"2026-04-21T08:33:02.377Z","repository":{"id":73687472,"uuid":"146356566","full_name":"halfzebra/algebraic-actions","owner":"halfzebra","description":"🌈 Algebraic Actions in Redux","archived":false,"fork":false,"pushed_at":"2018-08-28T14:01:40.000Z","size":113,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-20T10:21:12.580Z","etag":null,"topics":["algebraic-data-types","javascript","redux"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/halfzebra.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2018-08-27T21:30:07.000Z","updated_at":"2019-03-12T20:41:19.000Z","dependencies_parsed_at":"2023-02-25T10:46:32.653Z","dependency_job_id":null,"html_url":"https://github.com/halfzebra/algebraic-actions","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/halfzebra%2Falgebraic-actions","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/halfzebra%2Falgebraic-actions/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/halfzebra%2Falgebraic-actions/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/halfzebra%2Falgebraic-actions/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/halfzebra","download_url":"https://codeload.github.com/halfzebra/algebraic-actions/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243420922,"owners_count":20288172,"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":["algebraic-data-types","javascript","redux"],"created_at":"2024-11-19T08:38:06.519Z","updated_at":"2025-12-26T09:40:25.926Z","avatar_url":"https://github.com/halfzebra.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# algebraic-actions\n\nA library that helps representing Redux [Actions](https://redux.js.org/basics/actions) as an [Algebraic Union Type](https://en.wikipedia.org/wiki/Algebraic_data_type) in JavaScript.\n\nIn helps to describe state transitions in a type-safe manner with exhaustive Action coverage.\n## Usage\n\n```js\nconst Actions = withCase(fromObject({\n  Increment: PropTypes.any,\n  Decrement: PropTypes.any,\n  DecrementBy: PropTypes.number\n}));\n\nconst reducer = Actions.case({\n  Increment: state =\u003e state + 1,\n  Decrement: state =\u003e state - 1,\n  DecrementBy: (state, number) =\u003e state - number,\n  _: (state = 0) =\u003e state\n});\n\nconst store = createStore(reducer);\n\nstore.dispatch(Actions.Increment())\n```\n\n## Acknowledgements\n\n- [Elm: Custom Types](https://guide.elm-lang.org/types/custom_types.html)\n- [fantasyland/daggy](https://github.com/fantasyland/daggy)\n- [paldepind/union-type](https://github.com/paldepind/union-type)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhalfzebra%2Falgebraic-actions","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhalfzebra%2Falgebraic-actions","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhalfzebra%2Falgebraic-actions/lists"}