egui_hooks
React Hooks like API for egui
Status
- precise memory management (currently, directly uses the
egui::Memory
) - use_state
- use_persistent_state
- use_memo
- use_cache (a thin wrapper of caches in
egui::Memory
) - use_effect
- use_future (needs async runtime)
Usage
- use_state
// You can reset the initial state by changing the dependency list.
let = ui.use_state;
ui.label;
if ui.button.clicked
- use_memo
let = ui.use_state;
let memo = ui.use_memo;
ui.label;
ui.label;
if ui.button.clicked