Skip to content

params are not reactive with remote functions but params.key is #177

@ak4zh

Description

@ak4zh

Describe the bug

<script>
	import { getCount } from './data.remote';
	import { queryParameters, ssp } from 'sveltekit-search-params';
       
        // this works
        let nonSSP = $state({
            brand: 'audi',
            model: 'a1'
        })
        let nonSSPCountQuery = $derived(getCount(nonSSP))

        // this does not work
        const search = queryParameters({
		brand: ssp.string(),
		model: ssp.string()
	})
	let params = $derived(search)
	let countQuery = $derived(getCount(params))
        // but this works
	let countQueryWithDirectDependency = $derived(getCount(params.brand))
</script>

I have also tried

let params = $derived(queryParameters({
    brand: ssp.string(),
    model: ssp.string()
}))

Reproduction

https://www.sveltelab.dev/llrpqk8ytk63060

Logs

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions