{"id":14220360,"url":"https://github.com/worktile/store","last_synced_at":"2025-04-09T14:14:41.051Z","repository":{"id":39887143,"uuid":"149833692","full_name":"worktile/store","owner":"worktile","description":"🚀 A mini, yet powerful state management library for Angular.","archived":false,"fork":false,"pushed_at":"2025-03-27T07:10:57.000Z","size":4177,"stargazers_count":60,"open_issues_count":6,"forks_count":9,"subscribers_count":9,"default_branch":"master","last_synced_at":"2025-04-02T08:34:46.189Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://worktile.github.io/store/","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/worktile.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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":"2018-09-22T01:02:03.000Z","updated_at":"2025-03-27T07:09:57.000Z","dependencies_parsed_at":"2023-12-19T11:59:18.764Z","dependency_job_id":"4f33076d-1aec-4587-aa04-b2c68ea4fbe8","html_url":"https://github.com/worktile/store","commit_stats":{"total_commits":196,"total_committers":11,"mean_commits":"17.818181818181817","dds":0.326530612244898,"last_synced_commit":"66e6ac01f71dfa737dddacc970b27aa6b61e5102"},"previous_names":[],"tags_count":41,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/worktile%2Fstore","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/worktile%2Fstore/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/worktile%2Fstore/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/worktile%2Fstore/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/worktile","download_url":"https://codeload.github.com/worktile/store/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248054193,"owners_count":21039952,"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-19T15:01:41.689Z","updated_at":"2025-04-09T14:14:41.023Z","avatar_url":"https://github.com/worktile.png","language":"TypeScript","readme":"## @tethys/store\n\n[![GitHubActionCI](https://img.shields.io/github/workflow/status/tethys-org/store/ci-tethys-store-test)](https://github.com/tethys-org/store/actions/workflows/main.yml)\n[![Coverage Status][coveralls-image]][coveralls-url]\n![](https://img.shields.io/badge/Made%20with%20Angular-red?logo=angular)\n[![npm (scoped)](https://img.shields.io/npm/v/@tethys/store?style=flat)](https://www.npmjs.com/package/@tethys/store)\n[![npm](https://img.shields.io/npm/dm/@tethys/store)](https://www.npmjs.com/package/@tethys/store)\n[![release](https://img.shields.io/github/release-date/tethys-org/store.svg?style=flat\n)](https://github.com/atinc/ngx-tethys)\n[![docgeni](https://img.shields.io/badge/docs%20by-docgeni-348fe4)](https://github.com/docgeni/docgeni)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg?style=flat-square)](https://github.com/prettier/prettier)\n\n\n[coveralls-image]: https://coveralls.io/repos/github/tethys-org/store/badge.svg?branch=master\n[coveralls-url]: https://coveralls.io/github/tethys-org/store\n\nA mini, yet powerful state management library for Angular.\n\nEnglish | [中文文档](https://github.com/worktile/store/blob/master/README.zh-CN.md)\n## Features\n- Angular Styled, Store as a Service\n- DDD, multi-store model, each store belongs to a domain, state storage and actions are together\n- Easy to use API without excessive learning cost\n\n## Installation\n\n```\nnpm install @tethys/store --save\n# or if you are using yarn\nyarn add @tethys/store\n```\n\n## Simple Usage\n\n```ts\nimport { Injectable } from '@angular/core';\nimport { Action, Store } from '@tethys/store';\nimport { of } from 'rxjs';\nimport { tap } from 'rxjs/operators';\n\ninterface CounterState {\n    count: number;\n}\n\n@Injectable()\nexport class CounterStore extends Store\u003cCounterState\u003e {\n    static countSelector(state: CounterState) {\n        return state.count;\n    }\n\n    constructor() {\n        super({ count: 0 });\n    }\n\n    @Action()\n    increase() {\n        return of(true).pipe(\n            tap(() =\u003e {\n                this.update({ count: this.snapshot.count + 1 });\n            })\n        );\n    }\n\n    @Action()\n    decrease() {\n        return of(true).pipe(\n            tap(() =\u003e {\n                this.update((state) =\u003e {\n                    return {\n                        count: state.count - 1\n                    };\n                });\n            })\n        );\n    }\n}\n```\n\n```ts\n@Component({\n    selector: 'thy-store-counter-example',\n    template: `\u003cdiv\u003eCount: {{ count$ | async }}\u003c/div\u003e\n               \u003cbutton class=\"dg-btn dg-btn-primary dg-btn-sm\" (click)=\"increase()\"\u003e+\u003c/button\u003e\n               \u003cbutton class=\"dg-btn dg-btn-primary dg-btn-sm\" (click)=\"decrease()\"\u003e-\u003c/button\u003e\n`,\n    styleUrls: ['./counter.component.scss']\n})\nexport class ThyStoreCounterExampleComponent implements OnInit {\n    count$: Observable\u003cnumber\u003e = this.counterStore.select$(CounterStore.countSelector);\n\n    constructor(public counterStore: CounterStore) {}\n\n    ngOnInit(): void {}\n\n    increase() {\n        this.counterStore.increase();\n    }\n\n    decrease() {\n        this.counterStore.decrease();\n    }\n}\n```\n## Documentation\n\n- [Introduce](https://worktile.github.io/store/guides/intro)\n- [Getting Started](https://worktile.github.io/store/guides/getting-started)\n- [Store](https://worktile.github.io/store/guides/basic/store)\n- [Entity Store](https://worktile.github.io/store/guides/advanced/entity-store)\n- [Entity Store with References](https://worktile.github.io/store/guides/advanced/entity-store-references)\n- [FAQ](https://worktile.github.io/store/guides/faq)\n\n## Development\n```base\n$ git clone https://github.com/worktile/store\n$ cd store \u0026\u0026 yarn\n$ yarn start:docs // open http://localhost:8887\n```\n\n## Release \u0026 Publish\n\n```\nyarn release\nyarn pub\n```\n## LICENSE\n\n[MIT License](https://github.com/worktile/store/blob/master/LICENSE)\n","funding_links":[],"categories":["State Management"],"sub_categories":["Other State Libraries"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fworktile%2Fstore","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fworktile%2Fstore","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fworktile%2Fstore/lists"}