{"id":13755350,"url":"https://github.com/spacedragon/labrador_mobx_example","last_synced_at":"2025-05-10T01:30:49.132Z","repository":{"id":130695338,"uuid":"78942644","full_name":"spacedragon/labrador_mobx_example","owner":"spacedragon","description":null,"archived":false,"fork":false,"pushed_at":"2017-05-11T03:07:16.000Z","size":20,"stargazers_count":10,"open_issues_count":0,"forks_count":2,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-08-03T10:02:21.873Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/spacedragon.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}},"created_at":"2017-01-14T13:44:55.000Z","updated_at":"2023-03-26T09:05:07.000Z","dependencies_parsed_at":"2024-01-18T03:48:22.314Z","dependency_job_id":null,"html_url":"https://github.com/spacedragon/labrador_mobx_example","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/spacedragon%2Flabrador_mobx_example","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/spacedragon%2Flabrador_mobx_example/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/spacedragon%2Flabrador_mobx_example/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/spacedragon%2Flabrador_mobx_example/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/spacedragon","download_url":"https://codeload.github.com/spacedragon/labrador_mobx_example/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":224900798,"owners_count":17388942,"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-08-03T10:00:52.722Z","updated_at":"2024-11-16T09:30:37.923Z","avatar_url":"https://github.com/spacedragon.png","language":"JavaScript","funding_links":[],"categories":["Demo"],"sub_categories":[],"readme":"## What\n基于 [Labrador](https://github.com/maichong/labrador) 和 [mobx](https://mobx.js.org/index.html) 框架构建的小程序开发demo。\n\n## Why \nLabrador 开发框架使微信开发回到我们熟悉的开发环境和流程中来 ,  更多特性请参考 [Labrador](https://github.com/maichong/labrador)\n使用Mobx 来做状态管理相比 Redux 来说更简单易懂, 更自由,  代码更少.\n\n## How  \n\n```\n\tgit clone https://github.com/spacedragon/labrador_mobx_example.git\n\tnpm install\n\tnpm run dev\n```\n\n## So ...\n熟悉mobx 的看 hocs/observer.js  里面的注释\n\n## Known Issues\n1. Labrador 可能存在 [issue](https://github.com/maichong/labrador/issues/35)  所以目前package.json 里面使用的是我 fork 之后修改过的版本\n\n2. 微信小程序的 Page.setData(data)  对data 做了一次拷贝, 但是拷贝出来的对象丢失了 getter 方法, 这使得在 xml/wxml 界面绑定的时候取不到 mobx computed value ,  目前的解决方法是为 store 写一个 toJS 序列化方法, 将 computed value 转化为普通的 property .  (同样需要修改 labrador 框架)\n3. 目前使用mobx 2.7.0  , 目测 3.0.0  的版本在小程序环境中存在兼容性问题, 需要进一步研究.\n4. mobx 有可能比  redux / saga  更占空间 ,  注意小程序有 1m 的限制.  (mobx.min.js 有51k肯定比 redux 大许多, 但是因为mobx 需要的业务逻辑代码更少, 也许在更大的项目中会有优势)\n\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fspacedragon%2Flabrador_mobx_example","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fspacedragon%2Flabrador_mobx_example","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fspacedragon%2Flabrador_mobx_example/lists"}