Wow, so many conflicts, lol. I tried to rebase to master locally to resolve them, but for some reason, my VS Code doesn't show my branch at all.
Here is what I did in this commit:
Refactored MessageHub, same behavior but I'm trying to not rely on creating global listeners.
I played with useContext and useReducer a little bit and had stolen some design from Redux. The result is a DIY Redux, --- obviously not as robust as Redux, but, hey I had fun making it.
There is a centralStore and dispatch stored in Context, which any component can connect to via connect function.
If you want to access it without connecting to it, just use useContext.
Wow, so many conflicts, lol. I tried to rebase to master locally to resolve them, but for some reason, my VS Code doesn't show my branch at all.
Here is what I did in this commit:
Refactored MessageHub, same behavior but I'm trying to not rely on creating global listeners.
I played with
useContext
anduseReducer
a little bit and had stolen some design from Redux. The result is a DIY Redux, --- obviously not as robust as Redux, but, hey I had fun making it.There is a
centralStore
anddispatch
stored in Context, which any component can connect to viaconnect
function.If you want to access it without connecting to it, just use
useContext
.