Closed Philipp-M closed 1 week ago
IMO, we need at least one instantion somewhere, whether in an example or in a test.
Yeah an example is certainly worth it, also because I don't think it's the easiest thing to grasp for newcomers. I guess I can add one for xilem itself? Or should that be in xilem_core?
I think it would be good to have an example for Xilem itself.
I'd probably call it something like elm
? Because really that's us emulating the elm architecture
Is it possible for you to add a runnable example at this stage? It'd help with testing.
One thing I would say is that emulating the elm architecture is not necessarily the most idiomatic approach to using Xilem
Certainly not, though I could think that in an async context this could be useful, but that's a different story that needs more research.
I think we should explain that, but also explain that it is possible.
Probably (and I've added a comment at the top of that example). But on the other hand I don't think people will stumble over it and say "this is the better approach to handle state/messages in xilem" ^^. You likely need a good use-case for this.
Btw. does the name elm
for the example still make sense? As there's also e.g. map_state
in there.
I'd consider splitting into two examples: components
and elm
.
But I'm worried that components
might be a very small example. Maybe we can just stick it onto to_do_mvc
?
Maybe we can just stick it onto
to_do_mvc
Hmm I'm not sure where it would fit best without complicating things, an adapt
similar as in the xilem_web todomvc (i.e. send a message to the parent view, that the task can be deleted) would probably make more sense there.
Or do you mean using adapt
there instead of map_state
?
But I'm worried that
components
might be a very small example.
I don't think that's a bad thing, focus on one thing. A user can quickly see what it is about. I guess I'll do that components
example instead, and leave adapt
and map_action
in the elm
example
Ports
Adapt
to new xilem_core. It also addsMapState
which was previously calledAdaptState
and a new viewMapAction
which is basically about how elm works.MapAction
andAdapt
is shown in action in the addedelm
example, whileMapState
can be seen in action in the addedcomponents
example.