diff --git a/README.md b/README.md index 5bf3ca8..d9a8edc 100644 --- a/README.md +++ b/README.md @@ -54,11 +54,11 @@ The simplest and most effective way to use this library is by importing the meth Your username is {$username} ``` -the function returns a store so make sure to use it with the `$` prepended to handle auto-subscriprion. In case there's not a query parameter with the chosen name it will simply be null. +the function returns a store so make sure to use it with the `$` prepended to handle auto-subscription. In case there's not a query parameter with the chosen name it will simply be null. ### Writing to the store (single parameter) -Reading query parameters is cool but you know what is even cooler? Writing query parameters! With this library you can treat your store just like normal state in svelte. To update the state and conseguentely the url you can just do this +Reading query parameters is cool but you know what is even cooler? Writing query parameters! With this library you can treat your store just like normal state in svelte. To update the state and consequently the url you can just do this ```svelte ``` -## Vite dependecies error +## Vite dependencies error If you ran into issues with vite you need to update your `vite.config.ts` or `vite.config.js` file to include the plugin exported from `sveltekit-search-params/plugin`. It's as simple as diff --git a/playground/src/routes/+page.svelte b/playground/src/routes/+page.svelte index 261109b..81904b2 100644 --- a/playground/src/routes/+page.svelte +++ b/playground/src/routes/+page.svelte @@ -10,10 +10,12 @@ sort: false, }); const lz = queryParam('lz', ssp.lz()); + const base64 = queryParam('base64', ssp.base64()); let obj_changes = 0; let arr_changes = 0; let lz_changes = 0; + let base64_changes = 0; $: { // eslint-disable-next-line @typescript-eslint/no-unused-expressions @@ -31,6 +33,11 @@ $lz; lz_changes++; } + $: { + // eslint-disable-next-line @typescript-eslint/no-unused-expressions + $base64; + base64_changes++; + } @@ -87,6 +94,9 @@
{$lz}
+ +
{$base64}
+