bail out if url.sp and SvelteSp are already in sync

pull/12285/head
FoHoOV 2 years ago
parent b0c1df45fe
commit 53bb6a8069

@ -21,6 +21,9 @@ export class SvelteURL extends URL {
super(url);
this.#searchParams[REPLACE](url.searchParams);
this.#searchParams[onChange] = (command, ...args) => {
if (this.#searchParams.toString() === super.searchParams.toString()) {
return;
}
// by doing this, we sync SvelteSearchParams with internal implementation of URL.searchParams
// @ts-ignore
super.searchParams[command](...args);

Loading…
Cancel
Save