{"id":21025965,"url":"https://github.com/mminer/reduxity","last_synced_at":"2025-05-15T10:31:17.833Z","repository":{"id":50331077,"uuid":"518648978","full_name":"mminer/reduxity","owner":"mminer","description":"State management for Unity inspired by Redux.","archived":false,"fork":false,"pushed_at":"2022-07-28T00:29:49.000Z","size":4,"stargazers_count":4,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-03T07:37:58.805Z","etag":null,"topics":["redux","unity","unity3d"],"latest_commit_sha":null,"homepage":"","language":"C#","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/mminer.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-07-28T00:24:49.000Z","updated_at":"2022-10-25T15:41:28.000Z","dependencies_parsed_at":"2022-07-30T15:18:06.203Z","dependency_job_id":null,"html_url":"https://github.com/mminer/reduxity","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/mminer%2Freduxity","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mminer%2Freduxity/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mminer%2Freduxity/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mminer%2Freduxity/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mminer","download_url":"https://codeload.github.com/mminer/reduxity/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254322822,"owners_count":22051673,"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":["redux","unity","unity3d"],"created_at":"2024-11-19T11:40:50.630Z","updated_at":"2025-05-15T10:31:15.442Z","avatar_url":"https://github.com/mminer.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Reduxity\n\nRedux + Unity. Provides a bare-bones state management container inspired by\n[Redux](https://redux.js.org).\n\nRedux is heavily used in web development. Is this pattern a good fit for game\nstate? Probably not in most cases, but the experiment is ongoing.\n\n\n## Using\n\nDefine a state object:\n\n```csharp\nstruct GameState\n{\n    public Vector3Int playerPosition;\n}\n```\n\nAdd actions to affect the state:\n\n```csharp\ninterface IGameAction {}\n\nstruct MoveAction : IGameAction\n{\n    public Vector3Int direction;\n}\n```\n\nCreate a reducer to update the state when an action is dispatched:\n\n```csharp\nstatic GameState Reducer(GameState state, IGameAction action)\n{\n    switch (action)\n    {\n        case MoveAction moveAction:\n            state.playerPosition += moveAction.direction;\n            return state;\n\n        default:\n            return state;\n    }\n}\n```\n\nTie it all together with a store:\n\n```csharp\nStore\u003cGameState, IGameAction\u003e store = new(Reducer);\n```\n\nDispatch changes:\n\n```csharp\nstore.Dispatch(new MoveAction { direction = Vector3Int.up });\n```\n\nSubscribe to changes:\n\n```csharp\nstore.changed += _ =\u003e Debug.Log($\"New position: {store.state.playerPosition}\");\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmminer%2Freduxity","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmminer%2Freduxity","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmminer%2Freduxity/lists"}