React Zustand Tutorial - 8. setState, getState and separate actions from the store

  Рет қаралды 2,639

Conny Gu

Conny Gu

Күн бұрын

Пікірлер: 12
@OpenCoreX
@OpenCoreX 3 ай бұрын
Wow. This video is a Gem. Subscribed to your channel for more such amazing videos. Thanks. I am the 1000th subscriber :)
@PhilipIsaacs
@PhilipIsaacs 8 ай бұрын
These videos are great. I think your a very good teacher
@connygu
@connygu Жыл бұрын
code for this video: github.com/niftybytes4u/react_zustand_tutorial/tree/dc49cd9ef0315133d0393357c40c8b2610e8ba30
@meka4996
@meka4996 Жыл бұрын
Very nice! Thanks!
@FaramarzF.R
@FaramarzF.R 9 ай бұрын
You're Great 🎉.
@josht2602
@josht2602 Жыл бұрын
Hi, Conny, how can we add the action names to the actions? can we directly mutate the state in the separated actions like in the self-contained immer middleware does ?
@connygu
@connygu Жыл бұрын
Hi @josht, sorry, late for the answer, 1) I don't think, we can add the aciton name. But maybe we can ask the author Daishi to add this funciton. 2) I think, yes. Just try it.
@bugraotken
@bugraotken Жыл бұрын
Hi. If you ask generally, yes you can add names to the actions. Here is my own code below. { type: "addMessage", message, }, this type will be shown at devtools as name of the action and if you pass the second key (message here) you also get the payload at the devtools. Cheers! export const messageSlice: StateCreator< MessageSlice, [["zustand/devtools", never]], [], MessageSlice > = (set) => ({ messages: [], addMessage: (message: Message) => set( (state) => { return { messages: [...state.messages, message] }; }, false, { type: "addMessage", message, }, ), });
@venicebeachsurfer
@venicebeachsurfer 9 ай бұрын
Where is the devtools? I don't see it in the code, but I see it in the console?
@MatthewLeathes
@MatthewLeathes 5 ай бұрын
Check out video 5 in this playlist, hopefully that should show you how to set up devtools
@StephenRayner
@StephenRayner Жыл бұрын
🎉
@connygu
@connygu Жыл бұрын
😄
React Zustand Tutorial - 9. Typescript Suggestions
3:24
Conny Gu
Рет қаралды 1,9 М.
FOREVER BUNNY
00:14
Natan por Aí
Рет қаралды 8 МЛН
How Strong is Tin Foil? 💪
00:25
Brianna
Рет қаралды 71 МЛН
HELP!!!
00:46
Natan por Aí
Рет қаралды 65 МЛН
Don't Use React Context!! Use This instead
13:34
CoderOne
Рет қаралды 29 М.
[Taoism] Zhuangzi: Facing the loss of a loved one
8:14
Conny Gu
Рет қаралды 646
High-school student makes React a million times faster
2:47
Fireship
Рет қаралды 1,1 МЛН
FOREVER BUNNY
00:14
Natan por Aí
Рет қаралды 8 МЛН