Closed bpatram closed 6 years ago
@toddbluhm It seems you've added query param support in your fork! Are you planning on submitting a PR?
via https://github.com/toddbluhm/backbone-highway/commit/1dcac5d9ebd371b5dabe199fc25c489b443d4e96
Yeah I did add query param support. I also changed few other things and made the lib more promise compliant. I can see about PR'ing the Query Param stuff though if you like?
Hi @toddbluhm and @bpatram ! Thanks for your interest in this piece of code :)
I have been working on this router for years and it has seen many changes over time. The support for query parameters is a nice add and yes my url-composer
lib does support it already.
@toddbluhm if you already have an implementation in your fork i would be more than happy to integrate it via a PR.
Cheers
@toddbluhm I've checked out the modifications in your fork, very nicely done :)
I will go ahead then and parse out my changes and submit some separate PRs for them.
My current list of changes is the following:
.go({ query: { paramName: "value" } })
and in the action function function({ params, query: { paramName } })
(currently there is no easy way to declaratively define query params within the route string itself, but that could be changed)resolve/reject
from the action callback params and instead just returning an A+ Promise compliant promise from the action function (or nothing at all if async is not needed).Awesome :metal:
Add another option to the
go
function for aquery
object (for defining query parameters) and pass the query object along to the route action.It is already built into urlComposer https://github.com/RasCarlito/url-composer#usage
Example: