{"id":32281486,"url":"https://github.com/yiss/mobx_hooks","last_synced_at":"2025-10-23T00:57:55.564Z","repository":{"id":56834803,"uuid":"303751830","full_name":"yiss/mobx_hooks","owner":"yiss","description":"Flutter Hooks for MobX","archived":false,"fork":false,"pushed_at":"2020-10-18T22:15:50.000Z","size":58,"stargazers_count":11,"open_issues_count":4,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-10-23T00:57:46.057Z","etag":null,"topics":["flutter-hooks","hacktoberfest","mobx","riverpod"],"latest_commit_sha":null,"homepage":"","language":"Dart","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/yiss.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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":"2020-10-13T15:44:30.000Z","updated_at":"2023-09-27T06:04:23.000Z","dependencies_parsed_at":"2022-09-02T03:50:30.366Z","dependency_job_id":null,"html_url":"https://github.com/yiss/mobx_hooks","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/yiss/mobx_hooks","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yiss%2Fmobx_hooks","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yiss%2Fmobx_hooks/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yiss%2Fmobx_hooks/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yiss%2Fmobx_hooks/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/yiss","download_url":"https://codeload.github.com/yiss/mobx_hooks/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yiss%2Fmobx_hooks/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":280540658,"owners_count":26347724,"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","status":"online","status_checked_at":"2025-10-22T02:00:06.515Z","response_time":63,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["flutter-hooks","hacktoberfest","mobx","riverpod"],"created_at":"2025-10-23T00:57:44.577Z","updated_at":"2025-10-23T00:57:55.559Z","avatar_url":"https://github.com/yiss.png","language":"Dart","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![MIT license](https://img.shields.io/badge/License-MIT-blue.svg)](https://lbesson.mit-license.org/) [![codecov](https://codecov.io/gh/yiss/mobx_hooks/branch/master/graph/badge.svg)](https://codecov.io/gh/yiss/mobx_hooks) ![Build](https://github.com/yiss/mobx_hooks/workflows/Build/badge.svg) [![pub package](https://img.shields.io/pub/v/mobx_hooks.svg)](https://pub.dartlang.org/packages/mobx_hooks)\n\n\u003cimg src=\"https://github.com/yiss/mobx_hooks/raw/master/mobx_hooks.png\" width=\"300\"\u003e\n\n# Mobx Hooks\n\nFlutter Hooks for Mobx. This package attemp to bring [Flutter Hooks]() for [Mobx]()\n\n## Motivation \u0026 Inspiration :\n\nThe motivation for this project started when I wanted to migrate an old project of mine from Mobx to Riverpod and Flutter Hooks. But as much as I enjoyed using Riverpod and Flutter Hooks, I missed the ease of use of Mobx. So as I looked for something that combines both, but I couldn't find any.\n\n#### Inspirations :\n\nThis package was inspired and uses the following packages as dependecnies\n\n- [Flutter Hooks](https://github.com/rrousselGit/flutter_hooks) by [Remi Ressoulet](https://github.com/rrousselGit)\n- [MobX](https://mobx.netlify.app/)\n\n## Getting Started :\n\nJust add the dependency to mobx_hooks in your pubspec.yaml :\n\n```yaml\ndependecies:\n  mobx_hooks: latest\n```\n\n## Example :\n\nIf you're familiar with MobX and Flutter Hooks, using MobX Hooks is very easy. Here is an example using a counter :\n\n```dart\nclass Counter {\n  Counter() {\n    increment = Action(_increment);\n  }\n\n  final count = Observable(0);\n\n  Action increment;\n\n  void _increment() {\n    _value.value++;\n  }\n}\n\nfinal counter = Counter();\n\nclass MyApp extends StatelessWidget {\n  // This widget is the root of your application.\n  @override\n  Widget build(BuildContext context) {\n    return MaterialApp(\n      title: 'MobX Hooks',\n      theme: ThemeData(\n        primarySwatch: Colors.blue,\n      ),\n      home: const MyHomePage(),\n    );\n  }\n}\n\nclass MyHomePage extends HookWidget {\n  const MyHomePage();\n\n  @override\n  Widget build(BuildContext context) {\n    final count = useObservable(counter.count);\n    return Scaffold(\n      appBar: AppBar(\n        title: Text('MobX Counter'),\n      ),\n      body: Center(\n        child: Column(\n          mainAxisAlignment: MainAxisAlignment.center,\n          children: \u003cWidget\u003e[\n            Text(\n              'You have pushed the button this many times:',\n            ),\n            Text(\n                '${count.value}',\n                style: Theme.of(context).textTheme.headline4,\n            ),\n          ],\n        ),\n      ),\n      floatingActionButton: FloatingActionButton(\n        onPressed: counter.increment,\n        tooltip: 'Increment',\n        child: Icon(Icons.add),\n      ),\n    );\n  }\n}\n```\n\n## Hooks :\n\nThis is the initial list of Hooks available in this package. More are coming soon.\n\n| Name              | Description                                                                                               |\n| ----------------- | --------------------------------------------------------------------------------------------------------- |\n| [useObservable]() | Subscribes to an [Observable](https://mobx.netlify.app/api/observable) and return it's value              |\n| [useCompute]()    | Creates a Mobx [Computed](https://mobx.netlify.app/api/observable#computed) from the result of a function |\n| [useComputed]()   | Subscribes to the value of a [Computed](https://mobx.netlify.app/api/observable#computed)                 |\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyiss%2Fmobx_hooks","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fyiss%2Fmobx_hooks","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyiss%2Fmobx_hooks/lists"}