Add forward
method to FactoryVecDeque
objects
#522
Closed
chriskilding
started this conversation in
General
Replies: 1 comment
-
The essence of this has now been implemented in #523 FactoryVecDeque (and FactoryHashMap) are built using a builder API, which is fairly close to the prototype above. They can now forward events from their FactoryComponent children, just as a regular SimpleComponent can. See https://github.com/Relm4/Relm4/blob/273e167b1751ca122c3846ed8db6c8b19f901765/examples/state_management.rs for an example of how to use it. |
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
-
As I've previously mentioned I am looking at how to do state management in Relm apps with complex nested view models.
If you imagine a view hierarchy of
App
>Foo
, and you are only usingSimpleComponent
s, you can effectively bubble events up the view stack like this (and when it reaches the top, you can then forwardAppOutput
events into a headless document component that does loading/saving):But to make this approach viable, we also need the ability to do this with
Factory
components (Vecs, VecDequeues, Hashmaps). So we need something like:Is this the right user-facing DSL / API to achieve this? And if so, where in the Relm4 code should the
builder()
be added toFactoryVecDeque
? (I am happy to contribute a PR for this if you can give me the guidance.)Beta Was this translation helpful? Give feedback.
All reactions