paoloricciuti / sveltekit-search-params

The easiest way to read and WRITE from query parameters in sveltekit.
https://sveltekit-search-params.netlify.app
MIT License
549 stars 19 forks source link

first unsubscribe to params store stops updates with multiple subscribers #50

Closed dominikg closed 9 months ago

dominikg commented 11 months ago

Describe the bug

As soon as a component that uses a parameters store unsubscribes from it, the connection to sveltekits page store is severed. This prevents updates from reaching other subscribers to the same store.

Possible Solutions:

StartStopNotifier or counting subscribers to know when it is safe to unsubscribe from page

Reproduction

https://www.sveltelab.dev/2z7v7xq7im6erv1

Logs

No response

dominikg commented 11 months ago

happens here https://github.com/paoloricciuti/sveltekit-search-params/blob/517a3a8a80030b1ce1b1c66d39c18e7457fce44a/src/lib/sveltekit-search-params.ts#L226

paoloricciuti commented 11 months ago

This is fixed in the latest version @dominikg