Micro-frontends approach to solve once and for all the "problem" of router/stateful components #1102
marcodpt
started this conversation in
Show and tell
Replies: 1 comment
-
I simplified the router a lot.
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
After reading some parts of:
I thought of another approach to this problem. And I wrote this router.
Let's define a
component
as a function with this signature:Component(element, params) -> Promise stop?
element
: The DOM element where it should be mounted.params
: An object with the params passed to the component.stop
: An optional function that stops the component when it is called.Example:
This definition should handle the custom element case:
And it should also handle the case of the url:
This signature is the inspiration, but if you think this idea is interesting take a look at the README.md
Beta Was this translation helpful? Give feedback.
All reactions