1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
use {dioxus::prelude::*, modx::store}; #[store(Default)] pub struct CounterStore { pub count: i64, } impl CounterStore { pub fn inc(&mut self) { self.count += 1; } pub fn dec(&mut self) { self.count -= 1; } } #[allow(dead_code)] fn main() {}