{"id":26891875,"url":"https://github.com/mickeyjsx/mickey-model-extend","last_synced_at":"2025-10-15T22:53:03.800Z","repository":{"id":57296340,"uuid":"103611345","full_name":"mickeyjsx/mickey-model-extend","owner":"mickeyjsx","description":"Utility method to extend mickey model.","archived":false,"fork":false,"pushed_at":"2017-11-21T07:06:09.000Z","size":19,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-22T01:37:48.147Z","etag":null,"topics":["framework","mickey","model","utility"],"latest_commit_sha":null,"homepage":null,"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-09-15T03:49:56.000Z","updated_at":"2017-09-15T06:47:02.000Z","dependencies_parsed_at":"2022-09-07T03:20:45.793Z","dependency_job_id":null,"html_url":"https://github.com/mickeyjsx/mickey-model-extend","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/mickeyjsx%2Fmickey-model-extend","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mickeyjsx%2Fmickey-model-extend/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mickeyjsx%2Fmickey-model-extend/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mickeyjsx%2Fmickey-model-extend/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mickeyjsx","download_url":"https://codeload.github.com/mickeyjsx/mickey-model-extend/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246552908,"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","model","utility"],"created_at":"2025-03-31T22:41:55.308Z","updated_at":"2025-10-15T22:52:58.782Z","avatar_url":"https://github.com/mickeyjsx.png","language":"JavaScript","readme":"# mickey-model-extend\n\n\u003e Utility method to extend mickey model.\n\n[![MIT License](https://img.shields.io/badge/license-MIT_License-green.svg?style=flat-square)](https://github.com/mickeyjsx/mickey-model-extend/blob/master/LICENSE)\n\n[![NPM Version](https://img.shields.io/npm/v/mickey-model-extend.svg?style=flat-square)](https://www.npmjs.com/package/mickey-model-extend)\n[![Build Status](https://img.shields.io/travis/mickeyjsx/mickey-model-extend.svg?style=flat)](https://travis-ci.org/mickeyjsx/mickey-model-extend)\n[![Coverage Status](https://img.shields.io/coveralls/mickeyjsx/mickey-model-extend.svg?style=flat)](https://coveralls.io/r/mickeyjsx/mickey-model-extend)\n[![NPM downloads](http://img.shields.io/npm/dm/mickey-model-extend.svg?style=flat)](https://npmjs.org/package/mickey-model-extend)\n[![Dependencies](https://david-dm.org/mickeyjsx/mickey-model-extend/status.svg)](https://david-dm.org/mickeyjsx/mickey-model-extend)\n\n## Install\n\n```\n$ npm install --save mickey-model-extend\n```\n\n## Usage\n\n```es6\nimport modelExtend from 'mickey-model-extend';\n\nconst base = {\n  state: {\n    foo: null,\n  },\n  add: (state, payload) =\u003e state + payload,\n};\n\nconst model = modelExtend(base, {\n  namespace: 'foo.bar',\n  state: {\n    bar: 1,\n  },\n});\n\n```\n\n## API\n\n### modelExtend(...models) =\u003e Model\n\nBehaviour:\n\n- `model.namespace` will be overrided by latter model\n- `model.createReducer` will be overrided by latter model\n- `model.state` will be merged with `Object.assign`\n- `model.state` will be overrided by latter model if it isn't an object\n- `model[subscriptions|enhancers]` will be merged to a array\n- reducer functions will be merge with `Object.assign`\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-model-extend/issues/new).\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmickeyjsx%2Fmickey-model-extend","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmickeyjsx%2Fmickey-model-extend","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmickeyjsx%2Fmickey-model-extend/lists"}