I've been using easy-peasy for global state in my react typescript apps with great results. It's very friendly and minimal!
@jherr3 жыл бұрын
Sounds like my kind of state manager! :)
@align2source Жыл бұрын
These days I watch your channel whenever I have a snack while taking a break from my project! Actually much more entertaining than Netflix or HBO 💚🛸✨
@jherr Жыл бұрын
Wow! Netflix, ok. But HBO, with HOTD, wow! ;)
@ApurvaShekhar-hn5or Жыл бұрын
This helped me a lot. concise content.
@jovanaj83653 жыл бұрын
This series is a life saver!
@miguelyoutube100 Жыл бұрын
Thanks for the great video.
@1879heikkisorsa Жыл бұрын
Awesome!
@infisspablo8602 Жыл бұрын
Cool stuff
@jamesvo34622 жыл бұрын
good stuff
@ivayloyankov81202 жыл бұрын
I like it.
@robx_0012 жыл бұрын
awesome
@netvaibhav3 жыл бұрын
Thanks for the great video. react-use looks quite nice and minimal. How does it compare to Valtio?
@jherr3 жыл бұрын
Valtio is a great state manager. But it's doing the observables thing. So it's really a different model, IMHO. This `createGlobalState` is a "spot fix" for when you need state that is ... global. So if you are doing the custom hooks thing, then this would be great for that. But if you are doing more of a state manager approach that is light on hooks, then Valtio or Zustand would be a good choice.
@ДмитроСорока-г5ж Жыл бұрын
Thanks!
@AAquaticAApe2 жыл бұрын
Great series!
@higorcoimbra65912 жыл бұрын
Can you please clarify why the previous solution, using useReducer, was not globally available?
@denilsoncosta98373 жыл бұрын
normally for this use case i prefer zustand to handle global states. I use for exemple in multi-language cases.
@jherr3 жыл бұрын
:) Zustand is coming up. It's a personal favorite as well.
@denilsoncosta98373 жыл бұрын
@@jherr I can´t wait!
@PostMeridianLyf2 жыл бұрын
I've been doing Android dev for 2 years and came over to build my first react app. Is it really worth all the hassle to configure global contexts or would it be easier to use a viewmodel? In kotlin I can use a view model with live data that triggers changes in other fragments. I'm not sure if there is an equivalent in React/Ts? I hate being stuck on such a simple issue lol.
@jherr2 жыл бұрын
useState/useReducer would be the equivalent in React.
@PostMeridianLyf2 жыл бұрын
@@jherr I actually figured that out from another video of yours. You are the man! The react-use library set me straight! When I am no longer poor I will buy you a beer!
@PostMeridianLyf2 жыл бұрын
@@jherr I thought I had replied to this already but I guess it did not save. Thank you so much Jack! I learned more about react-use from another one of your videos and it really helped out! One day when i am not poor I will buy you a beer!
@cas8180283 жыл бұрын
Would useContext be better suited for this example?
@jherr3 жыл бұрын
Everything has pros/cons, but you can be the judge directly if you watch the useContext implementation in the previous episode - kzbin.info/www/bejne/haTIeGulhpeFeq8
@piotr50143 жыл бұрын
I'm doing all the same(I've even copied App and useTodos) and i got an error about invalid hook call when using useGlobalTodos(with no VSC problems appeard)
@jherr3 жыл бұрын
Feel free to jump on the Discord server and see if you can get some help on there.
@aryan7069_ Жыл бұрын
I have a question Is not changing state with setState(prev => new) more preferred than setState(new) Then why are you changin states like this
@jherr Жыл бұрын
I'm hearing more and more that setState(prev => new) should be used unless absolutely necessary, I'm not sure who is saying that, but it's not me and it's not the React documentation (read the section entitled "Is using an updater always preferred? "). Speaking more generally, if you hear advice that is super boolean (e.g. "Never do it like this."). Or you get advice that is clearly not supported by the official documentation. Then it's probably not great advice.
@adamlerman41733 жыл бұрын
comment for the algorithm XD
@mortezatourani77723 жыл бұрын
8:06 The main list didn't update!!! Something went wrong