You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It would be nice to have some guidance on best practices regarding state sharing between Relm4 components. These are the options I've considered so far:
Introduce global state using SharedState. This is relatively easily to implement but may make it harder to write isolated automated tests. The tab_game example uses this approach.
Pass down references to child components. I tried this at some point and got stuck trying to express the lifetime constraints.
Perhaps passing down RefCell/RefMut variables could work. Haven't tried this yet. It may sidestep lifetime issues but could introduce runtime panics if not managed properly.
Rely fully on message passing as opposed to shared state. This may be elaborate to maintain especially if there's a big hierarchy in your components.
The text was updated successfully, but these errors were encountered:
It would be nice to have some guidance on best practices regarding state sharing between Relm4 components. These are the options I've considered so far:
The text was updated successfully, but these errors were encountered: