{"id":15854298,"url":"https://github.com/afeiship/next-active-state","last_synced_at":"2026-04-24T16:36:19.795Z","repository":{"id":57122636,"uuid":"90757642","full_name":"afeiship/next-active-state","owner":"afeiship","description":"Mini state mananger based on proxy.","archived":false,"fork":false,"pushed_at":"2023-04-18T01:26:22.000Z","size":67,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-02-07T12:31:16.224Z","etag":null,"topics":["active","next","proxy","state"],"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/afeiship.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","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}},"created_at":"2017-05-09T14:49:31.000Z","updated_at":"2023-04-18T01:23:23.000Z","dependencies_parsed_at":"2024-12-14T12:21:40.148Z","dependency_job_id":null,"html_url":"https://github.com/afeiship/next-active-state","commit_stats":null,"previous_names":[],"tags_count":14,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/afeiship%2Fnext-active-state","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/afeiship%2Fnext-active-state/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/afeiship%2Fnext-active-state/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/afeiship%2Fnext-active-state/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/afeiship","download_url":"https://codeload.github.com/afeiship/next-active-state/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246696432,"owners_count":20819454,"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":["active","next","proxy","state"],"created_at":"2024-10-05T19:41:28.889Z","updated_at":"2026-04-24T16:36:19.754Z","avatar_url":"https://github.com/afeiship.png","language":"JavaScript","readme":"# next-active-state\n\u003e Mini state mananger based on proxy.\n\n[![version][version-image]][version-url]\n[![license][license-image]][license-url]\n[![size][size-image]][size-url]\n[![download][download-image]][download-url]\n\n## installation\n```bash\nnpm install -S @jswork/next-active-state\n```\n\n## apis\n| api     | params | description                          |\n| ------- | ------ | ------------------------------------ |\n| get     | -      | Unwrap proxy data to pure js object. |\n| on      | -      | Watch changed and return destroy fn. |\n| one     | -      | Watch changed and return destroy fn. |\n| reset   | -      | Watch changed and return destroy fn. |\n| touched | -      | Get state has touched.               |\n| #use    | -      | Use object with listener.            |\n| #toJS   | -      | Transform to pure js object.         |\n\n## usage\n```js\nimport NxActiveState from '@jswork/next-active-state';\n\nconst data = { key: 1, value: 2 };\nconst instance = new NxActiveState(data);\nconst state = instance.state;\n\nconst res = instance.on('change', (arg) =\u003e {\n  console.log(arg);\n});\n\n// create\nstate.newKey = 'I am new.';\n\n// update\nstate.key = 122;\n\n// delete\ndelete state.value;\n\n// destroy resource\nres.destroy();\n```\n\n```js\n// simple use\nconst data = { key: 1, value: 2 };\nconst state = NxActiveState.use(data, (arg) =\u003e {\n  console.log(arg);\n});\n\n// create\nstate.newKey = 'I am new.';\n\n// update\nstate.key = 122;\n\n// delete\ndelete state.value;\n\n// no need to destroy resource\n```\n\n\n## license\nCode released under [the MIT license](https://github.com/afeiship/next-active-state/blob/master/LICENSE.txt).\n\n[version-image]: https://img.shields.io/npm/v/@jswork/next-active-state\n[version-url]: https://npmjs.org/package/@jswork/next-active-state\n\n[license-image]: https://img.shields.io/npm/l/@jswork/next-active-state\n[license-url]: https://github.com/afeiship/next-active-state/blob/master/LICENSE.txt\n\n[size-image]: https://img.shields.io/bundlephobia/minzip/@jswork/next-active-state\n[size-url]: https://github.com/afeiship/next-active-state/blob/master/dist/next-active-state.min.js\n\n[download-image]: https://img.shields.io/npm/dm/@jswork/next-active-state\n[download-url]: https://www.npmjs.com/package/@jswork/next-active-state\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fafeiship%2Fnext-active-state","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fafeiship%2Fnext-active-state","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fafeiship%2Fnext-active-state/lists"}