The queryParameters function returns a store containing an object of all present search parameters.
Expected Parameters
You can define a schema of expected parameters. These will be merged into the resulting object even if they are not present in the current URL. If a parameter is missing, its value will be null (or its defaultValue if specified).
Encoding/Decoding in queryParameters
Just like queryParam, you can specify custom encoding/decoding or use ssp helpers for individual keys within the schema object.
<script lang="ts">
import { ssp, queryParameters } from 'sveltekit-search-params';
const store = queryParameters({
username: true,
isCool: ssp.boolean(true),
});
</script>
<pre>{JSON.stringify($store, null, 2)}</pre>