File tree Expand file tree Collapse file tree 2 files changed +9
-3
lines changed
Expand file tree Collapse file tree 2 files changed +9
-3
lines changed Original file line number Diff line number Diff line change 1+ ---
2+ " @effect-rx/rx " : patch
3+ ---
4+
5+ fix Rx.debounce behaviour
Original file line number Diff line number Diff line change @@ -1268,7 +1268,7 @@ export const debounce: {
12681268 } )
12691269 get . subscribe ( self , function ( val ) {
12701270 value = val
1271- if ( timeout ) return
1271+ if ( timeout ) clearTimeout ( timeout )
12721272 timeout = setTimeout ( update , millis )
12731273 } )
12741274 return value
@@ -1349,9 +1349,10 @@ export const searchParam = (name: string): Writable<string> =>
13491349 ( ctx , value : string ) => {
13501350 searchParamState . updates . set ( name , value )
13511351 ctx . setSelf ( value )
1352- if ( ! searchParamState . timeout ) {
1353- searchParamState . timeout = setTimeout ( updateSearchParams , 500 )
1352+ if ( searchParamState . timeout ) {
1353+ clearTimeout ( searchParamState . timeout )
13541354 }
1355+ searchParamState . timeout = setTimeout ( updateSearchParams , 500 )
13551356 }
13561357 )
13571358
You can’t perform that action at this time.
0 commit comments