{"id":21158227,"url":"https://github.com/simbo/small-store","last_synced_at":"2025-07-09T12:33:53.890Z","repository":{"id":57363771,"uuid":"321052004","full_name":"simbo/small-store","owner":"simbo","description":"A small, immutable and framework agnostic state store using rxjs and immer with native typescript support.","archived":false,"fork":false,"pushed_at":"2023-11-24T00:06:37.000Z","size":1066,"stargazers_count":10,"open_issues_count":0,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-11-09T22:33:18.553Z","etag":null,"topics":["angular","immutable","javascript","ngrx","preact","react","reactive","redux","state","store","typescript","vanilla","vue"],"latest_commit_sha":null,"homepage":"https://simbo.codes/small-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/simbo.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":"2020-12-13T11:46:49.000Z","updated_at":"2024-04-14T20:09:22.000Z","dependencies_parsed_at":"2022-09-16T16:43:31.620Z","dependency_job_id":null,"html_url":"https://github.com/simbo/small-store","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simbo%2Fsmall-store","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simbo%2Fsmall-store/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simbo%2Fsmall-store/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simbo%2Fsmall-store/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/simbo","download_url":"https://codeload.github.com/simbo/small-store/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225096831,"owners_count":17420292,"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":["angular","immutable","javascript","ngrx","preact","react","reactive","redux","state","store","typescript","vanilla","vue"],"created_at":"2024-11-20T12:18:52.711Z","updated_at":"2024-11-20T12:18:53.279Z","avatar_url":"https://github.com/simbo.png","language":"TypeScript","readme":"# 🗃 Small Store\n\n[![npm Package Version](https://img.shields.io/npm/v/small-store?)](https://www.npmjs.com/package/small-store)\n![Libraries.io dependency status for latest release](https://img.shields.io/librariesio/release/npm/small-store)\n[![Coveralls github](https://img.shields.io/coveralls/github/simbo/small-store)](https://coveralls.io/github/simbo/small-store)\n[![Last CI Workflow Status](https://img.shields.io/github/actions/workflow/status/simbo/small-store/ci.yml?branch=master)](https://github.com/simbo/small-store/actions?query=workflow%3ACI)\n[![GitHub Repo](https://img.shields.io/badge/repo-public-87ceeb)](https://github.com/simbo/small-store)\n[![License MIT](https://img.shields.io/badge/license-MIT-4cc552)](http://simbo.mit-license.org/)\n\n\u003e A small, immutable, reactive and framework agnostic state store under 2KB\n\u003e powered by rxjs and immer with native typescript support. To be used with\n\u003e vanilla, react, preact, angular, vue or whatever you like.\n\n---\n\n## Quick Start\n\n```typescript\nimport { Actions, Store } from 'small-store';\n\n// state declaration\ninterface CounterState {\n  count: number;\n}\n\n// actions\nenum CounterAction {\n  Increment = 'increment',\n  Decrement = 'decrement'\n}\n\n// action functions\nconst counterActions: Actions\u003cCounterState, CounterAction\u003e = {\n  [CounterAction.Increment]: () =\u003e state =\u003e {\n    state.count++;\n    return state;\n  },\n  [CounterAction.Decrement]: () =\u003e state =\u003e {\n    state.count--;\n    return state;\n  }\n};\n\n// the initial state\nconst initialCounterState: CounterState = {\n  count: 0\n};\n\n// creating the store\nconst counterStore = new Store\u003cCounterState, CounterAction\u003e(\n  initialCounterState,\n  counterActions\n);\n\n// subscribing to the store's state\ncounterStore.state$.subscribe(state =\u003e console.log(state));\n\n// dispatching actions\ncounterStore.dispatch(CounterAction.Increment);\ncounterStore.dispatch(CounterAction.Increment);\ncounterStore.dispatch(CounterAction.Decrement);\n```\n\nSee details and more examples in the [docs](https://simbo.codes/small-store/).\n\n## Documentation\n\nVisit **[simbo.codes/small-store](https://simbo.codes/small-store/)** to read\nthe documentation and the examples.\n\n## Development\n\nRequirements: node.js \u003e=14, yarn \u003e=1.22\n\n```sh\n# build using microbundle\nyarn build\n# watch and rebuild\nyarn build:watch\n# lint using prettier and eslint\nyarn lint\n# test using jest\nyarn test\n# watch and retest\nyarn test:watch\n# open coverage in default browser\nyarn coverage:open\n# check everything\nyarn preflight\n```\n\n### Docs\n\nRequirements: docker\n\n```sh\n# pull slate image\ndocker pull slatedocs/slate\n# serve docs on localhost:4567\nyarn docs:serve\n# build docs to ./docs-build\nyarn docs:build\n```\n\n## License and Author\n\n[MIT \u0026copy; Simon Lepel](http://simbo.mit-license.org/)\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsimbo%2Fsmall-store","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsimbo%2Fsmall-store","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsimbo%2Fsmall-store/lists"}