@@ -33,7 +33,7 @@ class URLWithReactiveSearchParams extends URL {
3333 * @override
3434 */
3535 get search ( ) {
36- this . searchParams . toString ( ) ;
36+ this . #reactive_search_params . toString ( ) ;
3737 this . #sync_params_with_url( 'search_params' ) ;
3838 return super . search ;
3939 }
@@ -50,7 +50,7 @@ class URLWithReactiveSearchParams extends URL {
5050 * @override
5151 */
5252 get href ( ) {
53- this . searchParams . toString ( ) ;
53+ this . #reactive_search_params . toString ( ) ;
5454 this . #sync_params_with_url( 'search_params' ) ;
5555 return super . href ;
5656 }
@@ -67,15 +67,15 @@ class URLWithReactiveSearchParams extends URL {
6767 * @param {"url" | "search_params" } changed_value
6868 */
6969 #sync_params_with_url( changed_value ) {
70- if ( super . searchParams . toString ( ) === this . searchParams . toString ( ) ) {
70+ if ( super . searchParams . toString ( ) === this . #reactive_search_params . toString ( ) ) {
7171 return ;
7272 }
7373
7474 if ( changed_value == 'url' ) {
7575 this . #update_search_params_from_url( ) ;
7676 } else {
7777 // updating url from params
78- this . search = this . searchParams . toString ( ) ;
78+ this . search = this . #reactive_search_params . toString ( ) ;
7979 }
8080 }
8181
@@ -87,34 +87,34 @@ class URLWithReactiveSearchParams extends URL {
8787 const keys_with_no_change = [ ] ;
8888
8989 // remove keys that don't exist anymore and notify others
90- for ( const [ key , value ] of Array . from ( this . searchParams . entries ( ) ) ) {
90+ for ( const [ key , value ] of Array . from ( this . #reactive_search_params . entries ( ) ) ) {
9191 if ( ! super . searchParams . has ( key ) || value == super . searchParams . get ( key ) ) {
9292 keys_with_no_change . push ( key ) ;
9393 untrack ( ( ) => {
94- this . searchParams . delete ( key ) ;
94+ this . #reactive_search_params . delete ( key ) ;
9595 } ) ;
9696 continue ;
9797 }
98- this . searchParams . delete ( key ) ;
98+ this . #reactive_search_params . delete ( key ) ;
9999 }
100100
101101 // set or update keys based on the params
102102 for ( const [ key , value ] of super . searchParams . entries ( ) ) {
103103 if ( keys_with_no_change . includes ( key ) ) {
104104 untrack ( ( ) => {
105- this . searchParams . set ( key , value ) ;
105+ this . #reactive_search_params . set ( key , value ) ;
106106 } ) ;
107107 continue ;
108108 }
109- this . searchParams . set ( key , value ) ;
109+ this . #reactive_search_params . set ( key , value ) ;
110110 }
111111 }
112112
113113 /**
114114 * @override
115115 */
116116 toString ( ) {
117- this . searchParams . toString ( ) ;
117+ this . #reactive_search_params . toString ( ) ;
118118 this . #sync_params_with_url( 'search_params' ) ;
119119 return super . toString ( ) ;
120120 }
0 commit comments