{"id":26891873,"url":"https://github.com/mickeyjsx/mickey","last_synced_at":"2025-10-19T00:24:24.405Z","repository":{"id":57296345,"uuid":"101721555","full_name":"mickeyjsx/mickey","owner":"mickeyjsx","description":"🤠 Lightweight front-end framework for creating React and Redux based app painlessly.","archived":false,"fork":false,"pushed_at":"2019-08-09T10:00:39.000Z","size":753,"stargazers_count":26,"open_issues_count":1,"forks_count":6,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-03-02T08:42:42.634Z","etag":null,"topics":["framework","mickey","react","react-router-v4","redux","redux-saga"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","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/mickeyjsx.png","metadata":{"files":{"readme":"README.md","changelog":null,"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":"2017-08-29T05:16:07.000Z","updated_at":"2022-08-23T06:29:32.000Z","dependencies_parsed_at":"2022-09-07T01:51:31.917Z","dependency_job_id":null,"html_url":"https://github.com/mickeyjsx/mickey","commit_stats":null,"previous_names":["bubkoo/mickey"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mickeyjsx%2Fmickey","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mickeyjsx%2Fmickey/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mickeyjsx%2Fmickey/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mickeyjsx%2Fmickey/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mickeyjsx","download_url":"https://codeload.github.com/mickeyjsx/mickey/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246552907,"owners_count":20795836,"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":["framework","mickey","react","react-router-v4","redux","redux-saga"],"created_at":"2025-03-31T22:41:55.207Z","updated_at":"2025-10-19T00:24:19.370Z","avatar_url":"https://github.com/mickeyjsx.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Mickey\n\n\u003cimg src=\"http://ojh17srjb.bkt.gdipper.com/mickey.svg\" alt=\"mickey.svg\" width=\"160px\" align=\"right\"\u003e\n\n\u003e Lightweight front-end framework for creating React and Redux based app painlessly.\n\n\u003e Totally base on [redux](https://github.com/reactjs/redux), [redux-saga](https://github.com/yelouafi/redux-saga) and [react-router](https://github.com/ReactTraining/react-router), very friendly to redux users. \n\n\u003e (Inspired by [dva](https://github.com/dvajs/dva))\n\n[![MIT License](https://img.shields.io/badge/license-MIT_License-green.svg?style=flat-square)](https://github.com/mickeyjsx/mickey/blob/master/LICENSE)\n\n[![NPM Version](https://img.shields.io/npm/v/mickey.svg?style=flat-square)](https://www.npmjs.com/package/mickey)\n[![Build Status](https://img.shields.io/travis/mickeyjsx/mickey.svg?style=flat)](https://travis-ci.org/mickeyjsx/mickey)\n[![Coverage Status](https://img.shields.io/coveralls/mickeyjsx/mickey.svg?style=flat)](https://coveralls.io/r/mickeyjsx/mickey)\n[![NPM downloads](http://img.shields.io/npm/dm/mickey.svg?style=flat)](https://npmjs.org/package/mickey)\n[![Dependencies](https://david-dm.org/mickeyjsx/mickey/status.svg)](https://david-dm.org/mickeyjsx/mickey)\n[![Package Quality](http://npm.packagequality.com/shield/mickey.svg)](http://packagequality.com/#?package=mickey)\n\n[查看中文](./docs/zh-CN/README.md)\n\n## Features\n\n- **Minimal API** (Only 6 newly introduced). Easy to learn, easy to start\n- **No [`diapatch`](https://github.com/reactjs/react-redux/blob/master/docs/api.md#inject-just-dispatch-and-dont-listen-to-store), no [`put`](https://redux-saga.js.org/docs/api/#putaction)**, just forget about [action types](http://redux.js.org/docs/basics/Actions.html)\n- **Support loading models dynamically** with [code-splitting](https://webpack.js.org/guides/code-splitting/) to improve performance\n- **Support HMR** for components and models with [babel-plugin-mickey-model-loader](https://github.com/mickeyjsx/babel-plugin-mickey-model-loader)\n- **Full-featured hook mechanism**\n\n## Quick Start\n\nUse [create-react-app](https://github.com/facebookincubator/create-react-app) to create an app:\n\n```shell\n$ npm i -g create-react-app\n$ create-react-app my-app\n```\n\nThen install mickey from npm:\n\n```shell\n$ cd my-app\n$ npm install mickey --save\n$ npm start\n```\n\nUpdate `index.js` as follow:\n\n```jsx\nimport React from 'react'\nimport createApp, {connect, injectActions} from 'mickey'\n\n// 1. Initialize\nconst app = createApp()\n\n// 2. Model\napp.model({\n  namespace: 'counter',\n  state: {\n    count: 0,\n    loading: false,\n  },\n  increment: state =\u003e ({ ...state, count: state.count + 1 }),\n  decrement: state =\u003e ({ ...state, count: state.count - 1 }),\n  incrementAsync: {\n    * effect(payload, { call }, { succeed }) {\n      const delay = timeout =\u003e new Promise((resolve) =\u003e {\n        setTimeout(resolve, timeout)\n      })\n      yield call(delay, 2000)\n      yield succeed()\n    },\n    prepare: state =\u003e ({ ...state, loading: true }),\n    succeed: state =\u003e ({ ...state, count: state.count + 1, loading: false }),\n  },\n})\n\n// 3. Component\nconst Comp = (props) =\u003e (\n  \u003cdiv\u003e\n    \u003ch1\u003e{props.counter.count}\u003c/h1\u003e\n    \u003cbutton onClick={() =\u003e props.actions.counter.decrement()}\u003e-\u003c/button\u003e\n    \u003cbutton onClick={() =\u003e props.actions.counter.increment()}\u003e+\u003c/button\u003e\n    \u003cbutton onClick={() =\u003e props.actions.counter.incrementAsync()}\u003e+ Async\u003c/button\u003e\n  \u003c/div\u003e\n)\n\n// 4. Connect state with component and inject `actions`\nconst App = injectActions(\n    connect(state =\u003e ({ counter: state.counter })(Comp))\n)\n\n// 5. View\napp.render(\u003cApp /\u003e, document.getElementById('root'))\n```\n\n## Examples\n\n- [Counter](./examples/counter): Basic usage of mickey\n- [Counter-Persist](./examples/counter-persist): Work with [redux-persist](https://github.com/rt2zz/redux-persist)\n- [Counter-Persist(v5)](./examples/counter-persist(v5)): Work with [redux-persist v5](https://github.com/rt2zz/redux-persist)\n- [Counter-Immutable](./examples/counter-immutable): Work with [ImmutableJS](https://github.com/facebook/immutable-js)\n- [Counter-Immer](./examples/counter-immer): Work with [Immer](https://github.com/mweststrate/immer)\n- [Counter-Persist-Immutable](./examples/counter-persist-immutable): Work with [redux-persist](https://github.com/rt2zz/redux-persist) and [ImmutableJS](https://github.com/facebook/immutable-js)\n- [Counter-Persist(v5)-Immutable](./examples/counter-persist(v5)-immutable): Work with [redux-persist v5](https://github.com/rt2zz/redux-persist) and [ImmutableJS](https://github.com/facebook/immutable-js)\n- [Counter-Undo](./examples/counter-undo): Work with [redux-undo](https://github.com/omnidan/redux-undo)\n- [Simple-Router](./examples/simple-router): Base on [react-router@4.x](https://reacttraining.com/react-router/)\n- [mickey-todo](https://github.com/mickeyjsx/mickey-todo) ([demo](https://mickeyjsx.github.io/todo)): Simple Todo application build with mickey\n- [mickey-vstar](https://github.com/mickeyjsx/mickey-vstar) ([demo](http://mickeyjsx.github.io/vstar)): A web app to show your or others GitHub repos stars\n- [HackerNews](https://github.com/mickeyjsx/mickey-hackernews) ([demo](http://mickeyjsx.github.io/hackernews)): [HackerNews](https://github.com/vuejs/vue-hackernews-2.0) clone built with mickey\n\n## More\n\n- [API Reference](./docs/en-US/api.md)\n- [API 文档](./docs/zh-CN/api.md)\n- [mickey.svg](./mickey.svg) badaged in this document is download from [Free Vectors](http://all-free-download.com/free-vector/download/disney-disney-vector_288586.html)\n\n\n## Related\n\n- [mickey-model-extend](https://github.com/mickeyjsx/mickey-model-extend) Utility method to extend mickey model\n- [babel-plugin-mickey-model-loader](https://github.com/mickeyjsx/babel-plugin-mickey-model-loader) Inject a model loader function to mickey instance with hmr support\n- [babel-plugin-mickey-model-validator](https://github.com/mickeyjsx/babel-plugin-mickey-model-validator) Validate models shipped by mickey to avoid certain syntax pitfalls\n\n\n## Contributing\n\nPull requests and stars are highly welcome.\n\nFor bugs and feature requests, please [create an issue](https://github.com/mickeyjsx/mickey/issues/new).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmickeyjsx%2Fmickey","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmickeyjsx%2Fmickey","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmickeyjsx%2Fmickey/lists"}