nandtotetris / computer-visualizer

0 stars 0 forks source link

Setup a global state management. #16

Closed Buranch closed 4 years ago

Buranch commented 4 years ago

We definitely need global state management in addition to the ones in each component since this project is data-driven it potentially needs a lot of components to component interaction. I think we all agree on using https://redux.js.org/ Let me know if you guys prefer the built-in ContextAPI

henites72 commented 4 years ago

@Buranch I prefer react context + hooks, redux is not that much flexible for asynchronous things, it needs redux-saga or redux-thunk which makes the code more complex.

We can have our own state management which behaves like redux using hooks + context @mezzzi @mikereze

mikerezene commented 4 years ago

@henites72 I completely agree. we don't need redux at all. we can do React context + Hooks. With Context, we can have global state management and there are also custom hooks we can use that make our state management similar to redux. So I prefer React Context + Hooks

Buranch commented 4 years ago

@mezzzi @henites72 Ok, Context + Hooks then.

henites72 commented 4 years ago

@Buranch thanks. I think we can close this issue, we can refactor the code to have a global state management once we started the project. It doesn't need an explicit setup as we do in redux, like installing redux and related packages

Buranch commented 4 years ago

Sure, we can re-open it when the need arises.