Closed matanmarkind closed 2 years ago
StoreRef
has been removed, on master you now get a direct Rc
of your state.
Your solution seems like a sound workaround. You could also add just the state as a dependency, instead of the entire StoreRef
. Something like use_effect_with_deps(..,store_ref.state().map(Rc::clone))
If the issue is pressing enough, I wouldn't be opposed to a quick patch for 0.7, however master is already much improved, just waiting on next Yew version to release.
Thanks for the response and your idea, definitely more convenient than what I was doing.
I don't think this is very pressing, just a nice to have for a future version (which is now irrelevant).
It would be great if
StoreRef
supportedPartialEq
since this would allow for using the store as the dependency inuse_effect_with_deps
. I am using yewdux_function 0.1 and to get around this I used:This assumes that I can store a
StoreRef
this way to check on repeatedly. This seemed to work in my code where the first run was occuring withstore.state()
returningNone
, so at least in my case that seems to hold.