You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When I create a new query param store with an empty array as the default value and showDefaults set to false, everything is fine on the first load. The query param is not added to the URL.
Adding an element to the array and the URL updates accordingly.
But now when I remove the object again or assign [] to the store, the query param is added to the URL with an empty array value.
@paoloricciuti Would love to hear you opinion on what the expected behavior should be. IMO the query param should disappear again after it has been reset to its default value.
Already have an idea that the issue comes from comparison by reference instead of comparison by value, but want to wait for your feedback first, before jumping into any code.
Cheers!
Reproduction
// creating the store, no query param in the URLconstparams=queryParam('params',ssp.array([]),{showDefaults: false});// adding element to store array, URL updates to ?params=["foo"]$params=['foo']// resetting store to empty array, URL updates to ?params=[]$params=[]
Logs
No response
The text was updated successfully, but these errors were encountered:
Describe the bug
Not sure if this is a bug, but let me explain.
When I create a new query param store with an empty array as the default value and showDefaults set to false, everything is fine on the first load. The query param is not added to the URL.
Adding an element to the array and the URL updates accordingly.
But now when I remove the object again or assign
[]
to the store, the query param is added to the URL with an empty array value.@paoloricciuti Would love to hear you opinion on what the expected behavior should be. IMO the query param should disappear again after it has been reset to its default value.
Already have an idea that the issue comes from comparison by reference instead of comparison by value, but want to wait for your feedback first, before jumping into any code.
Cheers!
Reproduction
Logs
No response
The text was updated successfully, but these errors were encountered: