Expenses | Using Redux Toolkit createSlice Function

preview_player
Показать описание
In this video we will refactor our code to use the createSlice function from Redux Toolkit.

Рекомендации по теме
Комментарии
Автор

Good stuff man! Your example makes slices vs reducers really easy to understand, and you explain what you're doing very clearly. 5/5 stars. :)

i_am_grid
Автор

You are a lifesafer, thanks so much for showing a simple slice and how to actually use it everywhere. So many of these tutorials skip essential steps that beginners don't understand

brobinbraauw
Автор

imo this is by far the best way to structure and write your redux code. Nice one!

richardmelkonian
Автор

Wohhh...I was looking for something like this, very clear to the point!!
Thank you

vineetpatel
Автор

Thank you so much for this dude! Very helpful video.

wzup
Автор

Thank you, just what i needed to understand redux toolkit

Elator
Автор

Exactly what I was looking for, thank you!

Kod.u
Автор

Had some problems as well with Redux Toolkit, the expense list did not update on POST, even though the expense was added to the database. Got the dreaded TypeError: action.payload is not iterable. Solved it by creating a new variable from the data from axios => const extractedExpense = [{id: data[]id, description: data.description, amount: data.amount}] and then dispatched extractedExpense into newExpense, instead of data directly from axios. Learning new things, even though I thought I knew React / Redux quite well, thanks again.

theodorn
Автор

Great informative video man, loved it!

shawjak
Автор

Nice video. I'd be curious to see what this would look like leveraging the rtk-query functionality. You apply state changes on top of the data loaded from the api, the examples on the react-toolkit page don't really have very satisfactory examples around this.

chriswininger
Автор

Great Video!, we can also make de fetch request in the slice also? Or its a bad practice

Franco
Автор

thank you, but I have a question. I also saw that you can make mutable operations inside your reducers in slice function, because redux toolkit uses Immer under the hood, so you can use methods like push instead of writing your own immutable logic like {...spread} or Object.assign() its kinda interesting, what can you say about it?

kirillpavlovskii
Автор

i just want to say " ty so much <3"

Krankerou
Автор

can you upload more videos like this please!!!~

fsdsdad
Автор

The repo is not working for me when I npm start the project. It throws "error adding new expenses??

ulyssesalvarezlaviada
Автор

I thought can write "mutable" code under createSlice()? Or is that just preference?

ericzedd