{"id":23882147,"url":"https://github.com/js2me/mobx-process","last_synced_at":"2025-04-14T22:52:29.873Z","repository":{"id":270808785,"uuid":"911539339","full_name":"js2me/mobx-process","owner":"js2me","description":"MobX code blocks working by start\\stop mechanism","archived":false,"fork":false,"pushed_at":"2025-04-13T08:21:10.000Z","size":577,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-14T22:52:24.492Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","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/js2me.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2025-01-03T08:58:42.000Z","updated_at":"2025-04-13T08:21:08.000Z","dependencies_parsed_at":"2025-01-03T22:31:46.596Z","dependency_job_id":null,"html_url":"https://github.com/js2me/mobx-process","commit_stats":null,"previous_names":["js2me/mobx-process"],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/js2me%2Fmobx-process","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/js2me%2Fmobx-process/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/js2me%2Fmobx-process/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/js2me%2Fmobx-process/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/js2me","download_url":"https://codeload.github.com/js2me/mobx-process/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248975318,"owners_count":21192208,"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":"2025-01-04T02:45:06.578Z","updated_at":"2025-04-14T22:52:29.855Z","avatar_url":"https://github.com/js2me.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cimg src=\"assets/logo.png\" align=\"right\" height=\"156\" alt=\"logo\" /\u003e\n\n# mobx-process  \n\n[![NPM version][npm-image]][npm-url] [![test status][github-test-actions-image]][github-actions-url] [![build status][github-build-actions-image]][github-actions-url] [![npm download][download-image]][download-url] [![bundle size][bundlephobia-image]][bundlephobia-url]\n\n\n[npm-image]: http://img.shields.io/npm/v/mobx-process.svg\n[npm-url]: http://npmjs.org/package/mobx-process\n[github-build-actions-image]: https://github.com/js2me/mobx-process/workflows/Build/badge.svg\n[github-test-actions-image]: https://github.com/js2me/mobx-process/workflows/Test/badge.svg\n[github-actions-url]: https://github.com/js2me/mobx-process/actions\n[download-image]: https://img.shields.io/npm/dm/mobx-process.svg\n[download-url]: https://npmjs.org/package/mobx-process\n[bundlephobia-url]: https://bundlephobia.com/result?p=mobx-process\n[bundlephobia-image]: https://badgen.net/bundlephobia/minzip/mobx-process\n\n_**MobX** code blocks working by start\\stop mechanism_  \n\nMain goal which these \"processes\" are needed is the executing some business logic across whole application. Naming \"process\" was borrowed from [FSD architectural methodology](https://feature-sliced.design/docs/get-started/overview#layers). More about this idea of this process implementation you can read [here](https://feature-sliced.design/docs/reference/layers#processes)\n\n# Usage  \n\n### 1. Create instance of the [`ProcessStore`](src/process-store.ts)   \n\nYou can create your own implementation or use [ready from package](src/process-store.impl.ts).   \n\n```ts\nimport { ProcessStoreImpl } from \"mobx-process\";\n\nconst processStore = new ProcessStoreImpl();\n```\n\n### 2. Create implementation of the [`Process`](src/process.ts)  \n\nOr you can use [ready from package](src/process.impl.ts).   \n\n```ts\nimport { Process, ProcessImpl } from \"mobx-process\";\n\nexport class MyProcess extends ProcessImpl implements Process {\n  childProcesses = [];\n\n  async start() {\n    // do some logic\n    await super.start();\n  }\n\n  async stop() {\n    await super.stop();\n  }\n}\n```\n\n### 3. Load process into store   \n\n```ts\nawait processStore.load(MyProcess)\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjs2me%2Fmobx-process","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjs2me%2Fmobx-process","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjs2me%2Fmobx-process/lists"}