{"id":19279179,"url":"https://github.com/unitymvr/umvr-package","last_synced_at":"2025-02-23T21:43:21.628Z","repository":{"id":179852295,"uuid":"664213408","full_name":"UnityMVR/umvr-package","owner":"UnityMVR","description":"Unity Model-View-Reactor framework","archived":false,"fork":false,"pushed_at":"2024-03-29T10:41:58.000Z","size":870,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-01-05T16:26:06.360Z","etag":null,"topics":[],"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/UnityMVR.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.md","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":"2023-07-09T09:07:00.000Z","updated_at":"2024-02-20T08:53:55.000Z","dependencies_parsed_at":"2023-12-22T10:27:17.991Z","dependency_job_id":"dec88379-4055-464d-8293-5a8fccc01b2b","html_url":"https://github.com/UnityMVR/umvr-package","commit_stats":null,"previous_names":["unitymvr/umvr-package"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/UnityMVR%2Fumvr-package","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/UnityMVR%2Fumvr-package/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/UnityMVR%2Fumvr-package/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/UnityMVR%2Fumvr-package/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/UnityMVR","download_url":"https://codeload.github.com/UnityMVR/umvr-package/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240385197,"owners_count":19792980,"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-09T21:13:57.000Z","updated_at":"2025-02-23T21:43:21.591Z","avatar_url":"https://github.com/UnityMVR.png","language":"C#","readme":"# Unity Model-View-Reactor\n\nTl;dr Unity architectural framework built on [Zenject](https://github.com/Mathijs-Bakker/Extenject) and [UniRx](https://github.com/neuecc/UniRx) with the purpose of speeding up development while encouraging well laid out architecture. It heavily relies on code generation. You could compare it to Ruby on Rails, in that it prefers convention over configuration and wants you to automate the repetitive stuff (but then, my experience with RoR is _very_ limited)\n\n## Reactor\n`Reactor` is just the name for MVPs `Presenter` with all the data exposed in form of UniRx data streams. In its current form, one presenter gets created for every model and you bind data manually, more or less like this:\n\n```\nusing UniRx;\nusing UnityEngine;\n\npublic partial class FooReactor\n{\n\tprotected override void BindDataSourceImpl(FooModel model)\n\t{\n\t\tSubscriptions.Add(model.GetProperty\u003cstring\u003e(nameof(IFoo.Text)).Subscribe(Debug.Log));\n\t}\n}\n```\n\nThere's also experimental implementation of automatic view binding, for the time being though (20/02/24), I discourage using it yet; it's still subject to change.\n\n## Repository\nThis is the second meaning of R in UMVR - `Repository` lays out the models in a predictable way. Think of it like of the way to make your model a little more like a database, with each Repository being a table.\nYou can get by primary key:\n```\nId totallyValidId = default;\nrepository.Get(totallyValidId);\n```\n\nYou can register secondary key and get by it:\n```\npublic FooRepository(FooReactorFactory fooReactorFactory, FooRepository repository) : base(fooReactorFactory)\n{\n\tAddIndex(nameof(IFoo.Text), new SecondaryIndex\u003cstring,IFoo\u003e(nameof(IFoo.Text), repository));\n}\n...\nrepository.GetBy(nameof(IFoo.Text), \"Hello world\");\n```\n\nAnd then there's the obvious stuff: `Added/Removed` events, iterators.\n\n## Conventions and assumptions\n\n1. Zenject usage is assumed and made easier by automatic generation of installers\n2. `Views` are written manually, Zenject will deliver them to `Reactors` automatically\n3. Rest of the stuff is generated: in Unity, `[Tools]-\u003e[UMVR]-\u003e[Generator]`\n4. You **should not** modify `Model` in `Reactors` to avoid circular dependencies. Write own `Controllers` to drive the logic and modify `Model`.\n5. `Views` should never touch `Model` directly - there's `ICommand` interface for that.\n6. Since UniRx uses `IDisposable` for subscription cleanup, it trickles down to UMVR as well. Most types are `IDisposable` so you can dispose your subscriptions easily. Bind to `IDisposable` in Zenject to automate that.\n\n## Credits\n\nMade possible, aside from [Zenject](https://github.com/Mathijs-Bakker/Extenject) and [UniRx](https://github.com/neuecc/UniRx), by [Mono.T4](https://github.com/mono/t4).\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Funitymvr%2Fumvr-package","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Funitymvr%2Fumvr-package","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Funitymvr%2Fumvr-package/lists"}