oolong-kt / oolong

MVU for Kotlin Multiplatform
http://oolong-kt.org
Apache License 2.0
298 stars 14 forks source link

[WIP] Add navigation component. #98

Closed pardom closed 4 years ago

pardom commented 4 years ago

Adds an abstraction over navigation which handles route changing, component delegation, and state caching. Example usage in the README.

Let's discuss! @oolong-kt/developers

pardom commented 4 years ago

Todo:

pardom commented 4 years ago

What should we use as a metaphor for delegated components?

Options:

torresmi commented 4 years ago

Nice job!

As far as the naming I would try to stay away from Component. In the Elm community it's actively suggested to not think in terms of "Components" as it doesn't help get out of an OOP mindset. This goes into it a little bit more https://guide.elm-lang.org/webapps/structure.html.

I often see these referred to as Page or Triplet (Model + View + Update). Page seems more familiar in web but Screen is similar. Screen is also used in other navigation libraries.

pardom commented 4 years ago

Good call-out. Currently, I'm using route for naming. Thoughts there? Also, perhaps this class should be a function that returns a triplet rather than an abstract class. That will make composition easier and steer this back away from OOP.

pardom commented 4 years ago

@torresmi does this seem like a reasonable name based on your experience in the Elm community? https://github.com/oolong-kt/oolong/pull/98/files#diff-cbd24fbe67157c95eff785c89b2b07c7R12

torresmi commented 4 years ago

Yep! I like it.

pardom commented 4 years ago

Closing this PR and moving work to another project.