Description
While the Switch trait allows for it, the derive Switch macro support for getting/setting the state is nonexistent, relying on manual implementations to actually allow setting the state.
This is fine for the moment, where just supporting the () state type is acceptable, but in the future, the macro needs to support setting and getting the state.
This might look like:
#[derive(Switch)]
enum AppRoute {
#[to="/home/{name}"]
Variant{
name: String,
#[state]
state: JsValue
}
}
Description
While the Switch trait allows for it, the derive Switch macro support for getting/setting the state is nonexistent, relying on manual implementations to actually allow setting the state.
This is fine for the moment, where just supporting the
()state type is acceptable, but in the future, the macro needs to support setting and getting the state.This might look like: