{"id":15699282,"url":"https://github.com/chanced/classy-store","last_synced_at":"2026-02-23T23:15:32.226Z","repository":{"id":54844458,"uuid":"391771387","full_name":"chanced/classy-store","owner":"chanced","description":"class based stores for svelte","archived":false,"fork":false,"pushed_at":"2021-08-04T03:38:39.000Z","size":233,"stargazers_count":6,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-09-16T14:48:35.604Z","etag":null,"topics":["state-management","stores","svelte","typescript"],"latest_commit_sha":null,"homepage":"","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/chanced.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":"2021-08-02T00:21:12.000Z","updated_at":"2023-10-23T20:07:11.000Z","dependencies_parsed_at":"2022-08-14T04:31:20.942Z","dependency_job_id":null,"html_url":"https://github.com/chanced/classy-store","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/chanced/classy-store","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chanced%2Fclassy-store","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chanced%2Fclassy-store/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chanced%2Fclassy-store/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chanced%2Fclassy-store/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/chanced","download_url":"https://codeload.github.com/chanced/classy-store/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chanced%2Fclassy-store/sbom","scorecard":{"id":273406,"data":{"date":"2025-08-11","repo":{"name":"github.com/chanced/classy-store","commit":"b3f956fe3221d253ca8cb15477155d55b8686b7c"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":2.8,"checks":[{"name":"Code-Review","score":0,"reason":"Found 0/30 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"SAST","score":0,"reason":"no SAST tool detected","details":["Warn: no pull requests merged into dev branch"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: no topLevel permission defined: .github/workflows/build.yml:1","Warn: no topLevel permission defined: .github/workflows/docs.yml:1","Warn: no topLevel permission defined: .github/workflows/publish.yml:1","Info: no jobLevel write permissions found"],"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Pinned-Dependencies","score":5,"reason":"dependency not pinned by hash detected -- score normalized to 5","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/build.yml:14: update your workflow using https://app.stepsecurity.io/secureworkflow/chanced/classy-store/build.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/build.yml:18: update your workflow using https://app.stepsecurity.io/secureworkflow/chanced/classy-store/build.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/docs.yml:11: update your workflow using https://app.stepsecurity.io/secureworkflow/chanced/classy-store/docs.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/docs.yml:15: update your workflow using https://app.stepsecurity.io/secureworkflow/chanced/classy-store/docs.yml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/docs.yml:28: update your workflow using https://app.stepsecurity.io/secureworkflow/chanced/classy-store/docs.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/publish.yml:10: update your workflow using https://app.stepsecurity.io/secureworkflow/chanced/classy-store/publish.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/publish.yml:14: update your workflow using https://app.stepsecurity.io/secureworkflow/chanced/classy-store/publish.yml/main?enable=pin","Warn: downloadThenRun not pinned by hash: .github/workflows/docs.yml:23","Info:   0 out of   6 GitHub-owned GitHubAction dependencies pinned","Info:   0 out of   1 third-party GitHubAction dependencies pinned","Info:   3 out of   3 npmCommand dependencies pinned","Info:   0 out of   1 downloadThenRun dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'main'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"Vulnerabilities","score":0,"reason":"14 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GHSA-93q8-gq69-wqmw","Warn: Project is vulnerable to: GHSA-v6h2-p8h4-qcjw","Warn: Project is vulnerable to: GHSA-grv7-fg5c-xmjg","Warn: Project is vulnerable to: GHSA-3xgq-45jj-v275","Warn: Project is vulnerable to: GHSA-9c47-m6qq-7p4h","Warn: Project is vulnerable to: GHSA-5v2h-r2cx-5xgj","Warn: Project is vulnerable to: GHSA-rrrm-qjm4-v8hf","Warn: Project is vulnerable to: GHSA-952p-6rrq-rcjv","Warn: Project is vulnerable to: GHSA-f8q6-p94x-37v3","Warn: Project is vulnerable to: GHSA-xvch-5gv4-984h","Warn: Project is vulnerable to: GHSA-gcx4-mw62-g8wm","Warn: Project is vulnerable to: GHSA-c2qf-rxjj-qqgw","Warn: Project is vulnerable to: GHSA-4wf5-vphf-c2xc","Warn: Project is vulnerable to: GHSA-j8xg-fqg3-53r7"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-17T13:54:53.325Z","repository_id":54844458,"created_at":"2025-08-17T13:54:53.325Z","updated_at":"2025-08-17T13:54:53.325Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29760247,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-23T21:02:23.375Z","status":"ssl_error","status_checked_at":"2026-02-23T20:58:31.539Z","response_time":90,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["state-management","stores","svelte","typescript"],"created_at":"2024-10-03T19:39:49.276Z","updated_at":"2026-02-23T23:15:32.208Z","avatar_url":"https://github.com/chanced.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# classy-store\n\nclass stores for svelte. \n\n## Usage\n\n```bash\nnpm i classy-store\n\n# yarn add classy-store\n```\n\nYou must enable `experimentalDecorators` in your tsconfig to use the `@mutator` decorator.\n\n### Define a store\n\n```typescript\nimport { mutator, Store } from \"classy-store\";\nexport class Spike extends Store\u003cSpike\u003e {\n\tname: string;\n\tcount: number;\n\tconstructor(name: string, count?: number) {\n\t\tsuper();\n\t\tthis.name = name;\n\t\tthis.count = count ?? 0;\n\t}\n\t@mutator\n\tinc(n = 1) {\n\t\tthis.count = this.count + n;\n\t\treturn this.count;\n\t}\n\n\t@mutator\n\tasync delayed() {\n\t\tawait new Promise((res) =\u003e setTimeout(res, 500));\n\t\tthis.count + 100;\n\t}\n}\n```\n\n\n### Use the store\n\n```html\n\u003cscript lang=\"ts\"\u003e\n\timport { Spike } from '$lib/spike';\n\tlet spike = new Spike('this is a store');\n\u003c/script\u003e\n\n\u003ch1\u003eHello {$spike.name}\u003c/h1\u003e\n\n\u003ch2\u003eBindings\u003c/h2\u003e\n\u003cinput bind:value={$spike.name} /\u003e\n\n\u003ch3\u003eUsing @mutator allows for methods:\u003c/h3\u003e\n\u003cbutton on:click={() =\u003e $spike.inc()}\u003e{$spike.count}\u003c/button\u003e\n\n\u003ch3\u003emethods can be promises:\u003c/h3\u003e\n\u003cbutton on:click={() =\u003e { $spike.delayed(); }}\u003elevel up\u003c/button\u003e\n```\n\n#### @mutator\n\n`@mutator` is a wrapper around your method which executes `store.broadcast` after your method is finished altering the store's state.\n\n- If your method returns a `Promise`, `broadcast` is called immediately and again when the promise is resolved or rejected.\n- If a `Promise` is returned, `executing[methodName]` is set to `Execution.Running`. \n- If the `Promise` resolves successfully, `executing[methodName]` is set to `Execution.Resolved`. \n- If the `Promise` is rejected, `executing[methodName]` is set to  `Execution.Rejected` \n- If the `Promise` is rejected, an `\"error\"` event is emitted with the reason.\n\n\n```html\n\u003cscript lang=\"ts\"\u003e\n\timport { Spike } from '$lib/spike';\n\timport { Execution } from 'classy-store'\n\tlet spike = new Spike('this is a store');\n\tlet disabled = false\n\t$: disabled = $spike.executing.delayed === Execution.Running\n\u003c/script\u003e\n\u003cbutton on:click={spike.delayed()} {disabled || undefined}\u003e{$spike.count}\u003c/button\u003e\n```\n\n\n\n\n\n#### errors\n\nThe default error handler stores `_errors` in a queue on your store. \nThe max size a configurable by setting `maxErrorsToStore` on `Options` \npassed to the `Store` constructor.\n\n\n#### Derived stores\n\nThe stores can be derived:\n\n```html\n\u003cscript lang=\"ts\"\u003e\n\timport { Spike } from \"$lib/spike\";\n\timport { derived } from \"svelte/store\";\n\tlet spike = new Spike(\"this is a store\");\n\tconst screaming = derived(spike, ($spike) =\u003e $spike.name.toUpperCase());\n\u003c/script\u003e\n\u003ch1\u003ehello {$screaming}\u003c/h1\u003e\n\n\u003cinput bind:value=\"{$spike.name}\" /\u003e\n```\n\n#### Custom Events\nThe stores are event emitters although more work is needed on that front.\n\nIf you wish to emit custom events, type your store such as:\n\n```typescript\ninterface MyEvents {\n\texample: (value: string) =\u003e void;\n}\n\nclass Spike extends Store\u003cSpike, MyEvents\u003e {\n\tconstructor() {\n\t\tsuper();\n\t\tthis.emit(\"example\", \"example should be typed\");\n\t}\n}\n```\n#### Partial updates\n\nYou can update the store with a new instance or a partial of the fields:\n\n```html\n\u003cscript lang=\"ts\"\u003e\n\timport { Spike } from \"$lib/spike\";\n\tlet spike = new Spike(\"this is a store\");\n\u003c/script\u003e\n\n\u003ch1\u003eHello {$spike.name}\u003c/h1\u003e\n\u003cbutton on:click={()=\u003e { $spike.set({name:\"...\"})}}\u003e\n```\n\n## Notes\n\nPlease feel free to create an issue for any question, feedback or bug you encounter.\n\n### Example REPL\n\nA [very simple javascript REPL is available here](https://svelte.dev/repl/585cbc7da2554a578a1f4d7661116bd0?version=3.41.0).\n\n### Dependencies\n\n-   [typed-emitter](https://github.com/andywer/typed-emitter)\n-   [events](https://github.com/browserify/events)\n\n## TODO:\n\n-   better name\n-   tests\n-   better docs\n\n## License\nMIT","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchanced%2Fclassy-store","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fchanced%2Fclassy-store","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchanced%2Fclassy-store/lists"}