{"id":15785885,"url":"https://github.com/js2me/mobx-view-model","last_synced_at":"2026-04-20T00:14:40.163Z","repository":{"id":249369516,"uuid":"831157366","full_name":"js2me/mobx-view-model","owner":"js2me","description":"⚡ Clean MVVM for React + MobX | Powerful ViewModels made simple ⚡","archived":false,"fork":false,"pushed_at":"2026-04-13T22:45:47.000Z","size":15008,"stargazers_count":13,"open_issues_count":2,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2026-04-13T23:34:16.759Z","etag":null,"topics":["mobx","mobx-react","mobx-view","mobx-view-model","mvvm","view-model"],"latest_commit_sha":null,"homepage":"https://js2me.github.io/mobx-view-model/","language":"TypeScript","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/js2me.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":".github/FUNDING.yml","license":"LICENSE","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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null},"funding":{"github":"js2me"}},"created_at":"2024-07-19T19:53:01.000Z","updated_at":"2026-04-13T22:45:52.000Z","dependencies_parsed_at":"2024-10-26T02:41:03.347Z","dependency_job_id":"fd6151ce-84e6-4948-b566-450e52becb33","html_url":"https://github.com/js2me/mobx-view-model","commit_stats":null,"previous_names":["js2me/mobx-vm-entities","js2me/mobx-view-model"],"tags_count":209,"template":false,"template_full_name":null,"purl":"pkg:github/js2me/mobx-view-model","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/js2me%2Fmobx-view-model","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/js2me%2Fmobx-view-model/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/js2me%2Fmobx-view-model/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/js2me%2Fmobx-view-model/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/js2me","download_url":"https://codeload.github.com/js2me/mobx-view-model/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/js2me%2Fmobx-view-model/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31950891,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-17T17:29:20.459Z","status":"ssl_error","status_checked_at":"2026-04-17T17:28:47.801Z","response_time":62,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["mobx","mobx-react","mobx-view","mobx-view-model","mvvm","view-model"],"created_at":"2024-10-04T20:41:47.411Z","updated_at":"2026-04-18T00:01:37.214Z","avatar_url":"https://github.com/js2me.png","language":"TypeScript","funding_links":["https://github.com/sponsors/js2me"],"categories":[],"sub_categories":[],"readme":"\u003cimg src=\"docs/public/logo.png\" align=\"right\" width=\"156\" alt=\"logo\" /\u003e\n\n# mobx-view-model  \n\n[![NPM version][npm-image]][npm-url] [![test status][github-test-actions-image]][github-actions-url] [![build status][github-build-actions-image]][github-actions-url] [![npm download][download-image]][download-url] [![bundle size][bundlephobia-image]][bundlephobia-url]\n\n\n[npm-image]: http://img.shields.io/npm/v/mobx-view-model.svg\n[npm-url]: http://npmjs.org/package/mobx-view-model\n[github-test-actions-image]: https://github.com/js2me/mobx-view-model/workflows/Test/badge.svg\n[github-build-actions-image]: https://github.com/js2me/mobx-view-model/workflows/Build/badge.svg\n[github-actions-url]: https://github.com/js2me/mobx-view-model/actions\n[download-image]: https://img.shields.io/npm/dm/mobx-view-model.svg\n[download-url]: https://npmjs.org/package/mobx-view-model\n[bundlephobia-url]: https://bundlephobia.com/result?p=mobx-view-model\n[bundlephobia-image]: https://badgen.net/bundlephobia/minzip/mobx-view-model\n\n\n⚡ Clean MVVM for React + MobX | Powerful ViewModels made simple ⚡  \n\nLibrary for integration [MVVM](https://en.wikipedia.org/wiki/Model%E2%80%93view%E2%80%93viewmodel) pattern with [MobX](https://mobx.js.org/README.html) and [React](https://react.dev/).  \n\n## [Read the docs →](https://js2me.github.io/mobx-view-model/)  \n\n\n_React's HOC approach_   \n```tsx\nimport { ViewModelBase } from \"mobx-view-model\";\nimport { withViewModel, ViewModelProps } from \"mobx-view-model-react\";\nimport { observer } from \"mobx-react-lite\";\nimport { action, observable } from \"mobx\";\n\nclass UserBadgeVM extends ViewModelBase\u003c{ userId: Maybe\u003cstring\u003e }\u003e {\n  private userSource = new UserSource({ abortSignal: this.unmountSignal });\n\n  protected willMount() {\n    this.userSource.connectWith(() =\u003e this.payload.userId)\n  }\n\n  get user() {\n    return this.userSource.data;\n  }\n\n  get isAdmin() {\n    return this.user?.isAdmin\n  }\n}\n\n...\n\nexport const UserBadge = withViewModel(UserBadgeVM, ({ model }) =\u003e (\n  \u003cdiv className={'size-4 bg-[green]'}\u003e\n    \u003ch3\u003e{model.user?.fullName}\u003c/h3\u003e\n    {model.isAdmin \u0026\u0026 \u003cspan\u003eadmin\u003c/span\u003e}\n  \u003c/div\u003e\n));\n\n...\n\n\u003cUserBadge payload={{ userId: '1' }} /\u003e\n```\n\n_React's hook approach_  \n```tsx\nimport { ViewModelBase, ViewModelPayload } from \"mobx-view-model\";\nimport { useCreateViewModel } from \"mobx-view-model-react\";\nimport { observer } from \"mobx-react-lite\";\nimport { action, observable } from \"mobx\";\n\nclass UserBadgeVM extends ViewModelBase\u003c{ userId: Maybe\u003cstring\u003e }\u003e {\n  private userSource = new UserSource({ abortSignal: this.unmountSignal });\n\n  protected willMount() {\n    this.userSource.connectWith(() =\u003e this.payload.userId)\n  }\n\n  get user() {\n    return this.userSource.data;\n  }\n\n  get isAdmin() {\n    return this.user?.isAdmin\n  }\n}\n\n...\n\nexport const UserBadge = observer(({ userId }: ViewModelPayload\u003cUserBadgeVM\u003e) =\u003e {\n  const model = useCreateViewModel(UserBadgeVM, { userId });\n\n  return (\n    \u003cdiv className={'size-4 bg-[green]'}\u003e\n      \u003ch3\u003e{model.user?.fullName}\u003c/h3\u003e\n      {model.isAdmin \u0026\u0026 \u003cspan\u003eadmin\u003c/span\u003e}\n    \u003c/div\u003e\n  )\n})\n\n...\n\n\u003cUserBadge payload={{ userId: '1' }}/\u003e\n```\n\n## Contribution Guide    \n\nWant to contribute ? [Follow this guide](https://github.com/js2me/mobx-view-model/blob/master/CONTRIBUTING.md)  \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjs2me%2Fmobx-view-model","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjs2me%2Fmobx-view-model","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjs2me%2Fmobx-view-model/lists"}