MCPcopy Create free account
hub / github.com/algoscienceacademy/RustUI / dispatch

Method dispatch

src/state/mod.rs:17–26  ·  view source on GitHub ↗
(&mut self, action: A)

Source from the content-addressed store, hash-verified

15 }
16
17 pub fn dispatch<A>(&mut self, action: A)
18 where
19 A: FnOnce(&mut T),
20 {
21 let mut state = self.state.lock().unwrap();
22 action(&mut state);
23 for subscriber in &self.subscribers {
24 subscriber(&state);
25 }
26 }
27
28 pub fn subscribe<F>(&mut self, callback: F)
29 where

Callers 1

mainFunction · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected