I am learning rust since about a year and yew/yewdux since a few weeks in my free time. One thing that took a lot of time and quite some help from the discord community was to figure out how to access the state in rust code that is not a yew component, so use_state() does not yield the state and dispatch, but a Hook instead.
Acually, the solution is in the documentation, but I have read it a lot of times but simply did not understand it correctly, and I focussed on use_state or alternatives instead.
I'd like to add a small change to the documentation in order to emphasize that
Dispatch::<Counter>::new();
can be used to access the dispatcher and the state from anywhere :)
Hi there,
I am learning rust since about a year and yew/yewdux since a few weeks in my free time. One thing that took a lot of time and quite some help from the discord community was to figure out how to access the state in rust code that is not a yew component, so use_state() does not yield the state and dispatch, but a Hook instead.
Acually, the solution is in the documentation, but I have read it a lot of times but simply did not understand it correctly, and I focussed on use_state or alternatives instead.
I'd like to add a small change to the documentation in order to emphasize that
can be used to access the dispatcher and the state from anywhere :)