Closed lukechu10 closed 2 years ago
Sounds great! Would love to see it :)
Feel free to setup the workspace as needed.
As I understand yewdux, there is possibility to create multiple roots = stores = sources of truth, what is a difference compared to Redux. There is a work used in Atlassian, https://atlassian.github.io/react-sweet-state/#/, which nicely combines Redux and React's context into single powerful tool. Yewdux-functional looks similarly to me, including possibility to access store from non-functional components. Is simply sounds great.
I have good experience with this mixed approach, because it allows better separation of concerns -- even global state is frequently better to have it split to pieces.
I'm strongly voting for this, can't wait :-).
This seems already done in #6
Think all that's really left here is proper documentation
yewdux-functional has been merged into yewdux (following Yew's example).
There should be an official integration with the upcoming functional components. This should probably belong in another
yewdux-functional
crate becauseyew
itself does not depend onyew-functional
.The API could simply be:
use_dispatch<T>() -> Dispatch<T>
that subscribes to the store and automatically triggers an update when the store is modifiedI would also like to propose making this repo a monorepo containing both
yewdux
andyewdux-functional
like theyew
repo.I can attempt implementing this if it's ok.