Redux Middleware Tutorial - Redux Tutorial #5

preview_player
Показать описание
Redux middleware is awesome, it allows you to keep the simplicity of Redux, yet extend it's functionality. Adding global things like loggers, error handlers, etc are incredibly simple.

As you see, adding redux middleware to our react app is incredibly easy.

-~-~~-~~~-~~-~-
Also watch: "Tailwind CSS - why CSS utility classes save so much time"
-~-~~-~~~-~~-~-
Рекомендации по теме
Комментарии
Автор

You seriously have a talent for explaining concepts clearly. Best Redux material I've seen so far.

bstrom
Автор

Now in 2020 this course is still the best one along the many videos on Redux I've looked through.
Thanks so much !!!

Sergey-mrbe
Автор

Wow! The explanation is so complete. 4:49 it's "AHHHH!!" then "Error: nailing it. Middleware first. Thanks.

saptadeepdutta
Автор

This series is my favourite of all programming series, you and Derek Banas make the coolest and most useful tutorials!

cyancoyote
Автор

console.log("AHHH!! Another awesome video!").

Davidlavieri
Автор

Thx dude your tuts are awsome, can't wait to see the next one.

geoffreypappaert
Автор

hello from Colombia ! i was starving for this video, thanks a lot and keep it up with the good work !!

alejandrobaezarcila
Автор

This is a great tutorial. Wouldn't the error handling calling next() cause the subscribe callback to get called twice, which might lead to some unnecessary processing?

matthewchung
Автор

4:20 no need to copy and paste, press cmd+shift+d to quickly duplicate a line ;)

JanoschMuller
Автор

What the heck is going on with logger? Where did that next function come from and why is the last function that is being returned the one firing and not the first function?

DawsonCosmos
Автор

Thank you for your tutorials. When I am trying to throw error differently than what you did in the video, some interesting things happened:

Inside the reducre, you are throwing error inside if, so it works:
if(action.type === "E") {
throw new Error("ErrorReducer");
}

However, if I try to throw error inside "else", it won't work, saying "Uncaught Error" in console:
if(blabla){}else{throw new Error("Error happen")}

Or, if I throw in "default" inside "switch", it won't work either:
switch(action.type){
case "CHANGE_NAME":{break;}
default: {throw new Error("Error happened")}
}

Looks like it only works when throwing error inside if. Otherwise it will force me to catch the error or it will lead to compile error. This should has something to do with the javascript error handling mechamism. Can you plese explain why?

toml
Автор

I think the logger function requires some extra explanation. It's hard to see what's going on here when "logger", "store", and "middleware" look interdependent. Store has middleware as a param, middleware has logger as a param, and logger has store as a param???

jessrichardsoncomedy
Автор

Thank you much Will. My life saver. I love middleware ^_^

qiuhongfu
Автор

when the next one is coming? It would be better if you explain what is the purpose of not mutating the existing states and creating new ones.It seems creating new states will take more memory while working in huge projects

srsundar
Автор

what advice can you give to someone who is having a lot of trouble with this. I created a node express app with users model and all the basic crud actions and routes to them. A basic react front end with a few components to show.

But im having the hardest time over a week trying to figure out how to connect that data to redux and get it to work??

my logic was ok ill just require my User model to this and refer to my model as User and i can call my methods etc. But i cannot grasp this how this works? any advice? i been watching videos, reading examples, trying out some stuff but failing miserably

whiskey
Автор

In the git files you posted, you have 'return next(action);' instead of 'next(action);' Is there any difference between the two?

marcalexander
Автор

hey there is no link between the REDUCER and DISPATCHER then how reducers taking propertys of what we dispatching, is automatically takes values of

ramusesandasari
Автор

so the order of the mw would be the order of parameters

JazevoAudiosurf
Автор

Someone knows the meaning of "1" at createStore ?

jose.salgado
Автор

Cant stop laughing with that error logger.... hahahahhahahahahah

JerickDuguran