Skip to content

Conversation

@laggingreflex
Copy link

@laggingreflex laggingreflex commented Oct 29, 2018

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

This uses the native [URL](-like) object instead of separate path/params.

[URL]: https://developer.mozilla.org/en-US/docs/Web/API/URL
@solkimicreb
Copy link
Owner

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

@solkimicreb
Copy link
Owner

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support path string similar to location.pathname Hash paths (#)

2 participants