react-easy-params
react-easy-params copied to clipboard
feat: use URL instead of path/params [breaking change]
I tried to fix #3, and fix #4. What do you think of this approach?
Instead of path
array and separate params
, this uses a URL(-like) object (only thing different is it has a .params
plain-object instead of searchParams)
SearchParams to params
feels like a hack, my original intention was to make searchParams
works just like it does on URL natively, but couldn't figure out how to trigger the observe
/syncUrl
function on searchParams.set
/append
methods. Might give it a shot later
Sorry, I totally missed this one. I will try to review ASAP.
Thanks for the PR, interesting idea for sure.
SearchParams to params feels like a hack, my original intention was to make searchParams works just like it does on URL natively, but couldn't figure out how to trigger the observe/syncUrl function on searchParams.set/append methods.
Doesn't this work out of the box? If the searchParams.set/append are written in JS and not native code it should work, otherwise it won't. I don't know which is the case.