{"id":13735548,"url":"https://github.com/buhrmi/query-store","last_synced_at":"2025-04-11T11:53:56.593Z","repository":{"id":49552447,"uuid":"251191191","full_name":"buhrmi/query-store","owner":"buhrmi","description":"Keeps the browser's querystring in sync with a Svelte store","archived":false,"fork":false,"pushed_at":"2021-06-18T02:55:15.000Z","size":14,"stargazers_count":44,"open_issues_count":1,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-06T14:08:58.043Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/buhrmi.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-03-30T03:25:52.000Z","updated_at":"2024-10-13T17:51:31.000Z","dependencies_parsed_at":"2022-08-20T09:31:16.993Z","dependency_job_id":null,"html_url":"https://github.com/buhrmi/query-store","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/buhrmi%2Fquery-store","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/buhrmi%2Fquery-store/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/buhrmi%2Fquery-store/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/buhrmi%2Fquery-store/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/buhrmi","download_url":"https://codeload.github.com/buhrmi/query-store/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248391290,"owners_count":21095987,"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-03T03:01:08.053Z","updated_at":"2025-04-11T11:53:56.529Z","avatar_url":"https://github.com/buhrmi.png","language":"JavaScript","readme":"# query-store\n\nquery-store gives you a writable svelte store that syncs with the URL's search params. Makes for easy bookmarking and sharing of UI state.\n\n## Usage\n\n```html\n\u003cscript\u003e\nimport query from 'query-store'\n\u003c/script\u003e\n\n\u003cinput bind:value={$query.someparam}\u003e\n```\n\n![demo](https://i.imgur.com/zhm9IkY.gif)\n\nAnd that's all there is to it.\n\n\n### History Navigation\n\nTo create a history entry on each query change (using pushState instead of replaceState), call `keepHistory` with the name of the param.\n\n```html\n\u003cscript\u003e\nimport query from 'query-store'\nquery.keepHistory('seed')\n\u003c/script\u003e\n\nCurrent seed is {$query.seed}\n\u003cbutton on:click={() =\u003e $query.seed = Math.random()}\u003eGenerate new seed\u003c/button\u003e\n```\n\n### Integrate with routers\n\nIf you use a router that has its own navigation handling (eg Sapper), you can sync the router's query params to the query store like this:\n\n```html\n\u003cscript\u003e\nimport query from 'query-store'\nimport { stores } from '@sapper/app'\n\nconst { page } = stores()\n$: query.setWithoutHistory($page.query)\n\u003c/script\u003e\n\nCurrent tab is {$query.tab}\n\n\u003ca href=\"{$page.path}?tab=general\"\u003eHome\u003c/a\u003e\n\u003ca href=\"{$page.path}?tab=details\"\u003eDetails\u003c/a\u003e\n\u003ca href=\"{$page.path}?tab=edit\"\u003eEdit\u003c/a\u003e\n```\n","funding_links":[],"categories":["Browser Navigation"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbuhrmi%2Fquery-store","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbuhrmi%2Fquery-store","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbuhrmi%2Fquery-store/lists"}