Macro freya::prelude::use_reactive
macro_rules! use_reactive { (|| $($rest:tt)*) => { ... }; (| $($args:tt),* | $($rest:tt)*) => { ... }; }
Expand description
A helper macro for use_reactive
that merges uses the closure syntax to elaborate the dependency array
Takes some non-reactive data, and a closure and returns a closure that will subscribe to that non-reactive data as if it were reactive.
§Example
use dioxus::prelude::*;
let data = 5;
use_effect(use_reactive!(|data| {
println!("Data changed: {}", data);
}));