Zaid-Ajaj / Feliz.Router

A router component for React and Elmish that is focused, powerful and extremely easy to use.
MIT License
78 stars 16 forks source link

There should be a similar thing as navigate but returns a string #9

Closed mastoj closed 4 years ago

mastoj commented 4 years ago

Router.navigate is really nice when navigating programmatically. However, it would be nice to have the same thing when setting the href on a a tag. Basically I would like to write:

Html.a [
    prop.href (Router.somethingLikeNavigate("apage"))
]

I can have a simple work around with prop.onClick but doesn't it make sense to have what I suggest?

Zaid-Ajaj commented 4 years ago

Hello @mastoj, I guess you are looking for something like Router.format? Should be easy to add, just copy pasting a bunch of Router.navigate but instead returning a string instead of command.

Do you want to take a stab at it 🙏 ? PRs are always welcome :smile:

mastoj commented 4 years ago

That was what I was planning as well :).

I just wanted to make sure it makes sense first.

Zaid-Ajaj commented 4 years ago

That would be really awesome :heart: