Sharing state between views #276
Unanswered
abhijeetbhagat
asked this question in
Q&A
Replies: 1 comment
-
I don't know what you mean by a view, or by owning it. Normally if I have two views of the same state I'd write two functions for it: fn first_view(ui: &mut egui::Ui, state: &MyState) {
…
}
fn second_view(ui: &mut egui::Ui, state: &MyState) {
…
} |
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
-
Is there a specific way to share app state between different views? I have a couple of views and they are all owned by a 'main app'. These views call backend services and I want to pass data received by one view through its service to another view for various activities like displaying on the view or passing to a service.
At the moment, I am using the Arc-Mutex/Arc-RwLock patterns to share state between different views. Any suggestions?
Beta Was this translation helpful? Give feedback.
All reactions