react-easy-params icon indicating copy to clipboard operation
react-easy-params copied to clipboard

feat: use URL instead of path/params [breaking change]

Open laggingreflex opened this issue 5 years ago • 2 comments

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

laggingreflex avatar Oct 29 '18 11:10 laggingreflex

Sorry, I totally missed this one. I will try to review ASAP.

solkimicreb avatar Nov 17 '18 22:11 solkimicreb

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.

solkimicreb avatar Nov 17 '18 22:11 solkimicreb