Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Standardize router solution #55

Open
OlivierBlanvillain opened this issue Apr 25, 2017 · 1 comment
Open

Standardize router solution #55

OlivierBlanvillain opened this issue Apr 25, 2017 · 1 comment

Comments

@OlivierBlanvillain
Copy link
Owner

The mini website showing the example has keeps a bijection between URL and active example, it's a bit of a crude implementation but it works. There is definitely room for standardization here, and unlike the FutureRx thing, router require non trivial amount of engineering.

@bbarker
Copy link
Contributor

bbarker commented Oct 5, 2017

I've been working on a simple Router (referenced in #77), which may be good enough for me (and may not be also - we shall see). Which router implementation are you referring to when you say FutureRx (assuming there's a concrete example somewhere that I missed)?

I sort of like how this style of router (which can likely be simplified) can easily be plugged into a component (see below), since it has its own isolated view. The component's view just becomes the router's view, so the router is simply used as a light formalism. Not much to it - monadic-html does all the hard work.

Components are also a fairly light formalism, for example:

  sealed abstract class AbstractComponent[D](view: Node, model: Rx[D])
  case class Component[D](view: Node, model: Rx[D]) extends AbstractComponent[D](view, model)

  /**
    * TaggedComponent is useful for updating a collection of components where one would want to
    * sometimes alter Component[D] based on input data of type T
    */
  case class TaggedComponent[D,T](view: Node, model: Rx[D], tag: T) extends AbstractComponent[D](view, model)

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

No branches or pull requests

2 participants