Closed neo-sam closed 4 years ago
Oh I know, I didn't obey flux design model at all.
Flux: Action -> Dispatch -> Store -> View Me: Action -> Model(Store) -> Dispatch -> View
I'm using eventbus subscribe design model actually.
If there are no trouble, you can close this issue.
Since this question is asking for opinions and help, you would get better replies and reach a wider audience by asking on Stack Overflow instead.
Case Background
I'm going to make a simplified photoshop like app using react.js, which has a thousands of state such like using tools, drawing history, brush point, brush size, ........ etc.
I have considered using redux, mobx, react context to manage all kinds of the app states, but they are still too "stupid" in my case:
So, I think use typescript oop program skills and flux design mode is right for me. However, there is too few technical documentation about flux. So, can you tell me the code below a good way to practice flux with oop?
Code
I'm sure I wouldn't do heavy calculate on
Model.addText()
method, and do some optimization in other multi states components.Is the code above obey flux design principle, or any problems relating to my hooks?