{"id":15288427,"url":"https://github.com/nasso/svelte-bound-store","last_synced_at":"2025-07-14T08:32:40.703Z","repository":{"id":194681146,"uuid":"685662536","full_name":"nasso/svelte-bound-store","owner":"nasso","description":null,"archived":false,"fork":false,"pushed_at":"2023-09-14T16:35:30.000Z","size":50,"stargazers_count":7,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-06-15T09:17:31.572Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/nasso.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}},"created_at":"2023-08-31T18:14:36.000Z","updated_at":"2025-04-29T17:11:24.000Z","dependencies_parsed_at":"2023-09-14T16:58:01.088Z","dependency_job_id":null,"html_url":"https://github.com/nasso/svelte-bound-store","commit_stats":null,"previous_names":["nasso/svelte-bound-store"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/nasso/svelte-bound-store","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nasso%2Fsvelte-bound-store","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nasso%2Fsvelte-bound-store/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nasso%2Fsvelte-bound-store/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nasso%2Fsvelte-bound-store/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nasso","download_url":"https://codeload.github.com/nasso/svelte-bound-store/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nasso%2Fsvelte-bound-store/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265262625,"owners_count":23736433,"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-09-30T15:48:45.709Z","updated_at":"2025-07-14T08:32:40.664Z","avatar_url":"https://github.com/nasso.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# `svelte-bound-store`\n\n`bound` is like `derived`, but the function returns another store.\n\n## Usage\n\n```js\nimport { writable } from \"svelte/store\";\nimport { bound } from \"svelte-bound-store\";\n\nconst foo = writable(\"foo\");\nconst bar = writable(\"bar\");\nconst baz = writable(\"baz\");\nconst state = writable({\n  index: 0,\n  items: [foo, bar, baz],\n});\n\nconst current = bound(state, ({ index, items }) =\u003e items[index]);\n\ncurrent.subscribe(console.log); // \"foo\"\n\nfoo.set(\"foo2\"); // \"foo2\"\n\n// change the index\nstate.update((state) =\u003e ({ ...state, index: 1 })); // \"bar\"\n\nfoo.set(\"foo3\"); // logs nothing because `current` is no longer bound to `foo`\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnasso%2Fsvelte-bound-store","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnasso%2Fsvelte-bound-store","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnasso%2Fsvelte-bound-store/lists"}