How to React to When an Object Changes in JavaScript

preview_player
Показать описание
In today's video I'll show you how you can use the Proxy object in JavaScript to react to when an object changes. We also have a look at an example of building a reactive UI using this technique.

For your reference, check this out:

If this video helped you out and you'd like to see more, make sure to leave a like and subscribe to dcode!

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

Great tutorial on the lesser-known features of JavaScript.

collinsk
Автор

I was trying to update my Shopping cart modal in realtime as I incremented/decremented the item and found your video on mutationObserver from 4 years ago and it helped a lot. Then 2 days ago this video comes out, which is even more perfect. Pretty soon I won't even need React.

spondoolie
Автор

This is the best video for explaining JS proxy

KiranMuralee
Автор

Thanks for uploading this! What if the objects you want to monitor were created with a constructor function? Do you know of any work arounds?

I know you mentioned 2 possible work arounds : at 8:00, passing in the target as an object literal and at 9:40 when you pass in the target as a cloned new object.... but these don't seem to work in the above situation/

sam-hrj
Автор

Wow, i had no idea. This is like 10 years old now...

offgridvince
Автор

Didn't know about that. would you be able to make a real exemple like a simple shopping cart as a user say in comment ? Thanks

alexandre
Автор

Is this the way modern frameworks (React / Vue) work under the hood?

Uncaught_in_promise
Автор

Looks like you are rewriting React LOL

igorr
welcome to shbcf.ru