How to use Proxy Objects - JavaScript Tutorial

  Рет қаралды 32,813

dcode

dcode

Күн бұрын

Пікірлер: 32
@ricardopassos1180
@ricardopassos1180 3 жыл бұрын
I barely understand English, but your way of explaining the Proxy API is by far the best I've found
@dcode-software
@dcode-software 3 жыл бұрын
That's awesome to hear!
@luisdwq123
@luisdwq123 3 жыл бұрын
I was having a hard time understanding proxies, your explanation really helped thanks :)
@dcode-software
@dcode-software 3 жыл бұрын
You're welcome and thanks for the Twitter follow!
@licokr
@licokr Жыл бұрын
Awesome, easy and clear. Thank you for the video!
@hanjelly5410
@hanjelly5410 3 жыл бұрын
Crystal clear and easy to understand!
@dcode-software
@dcode-software 3 жыл бұрын
Awesome
@Dan-p7f
@Dan-p7f 2 жыл бұрын
Thank you so much. You're channel is being very helpful on couple topics for me. Subbed + liked
@yinonelbaz5309
@yinonelbaz5309 2 жыл бұрын
Crystal clear and easy to understand
@VladdyHell
@VladdyHell 2 жыл бұрын
What are some of the good uses for it? As far as I can think of is default configurations for your app, e.g. default Express configurations like ports, etc. defined in a JSON format.
@ozzyfromspace
@ozzyfromspace Жыл бұрын
I wrote a little utility that allows me to perform array-like operations on an object (iterate in loops, push, pop, etc.) Using a proxy to achieve this ended up helping helping me account for unexpected user behaviors (eg. otherwise it's hard to catch a user running a push on what I deem a tuple in a runtime context). That's my little use case from earlier today. The world's second most popular typescript framework, VueJS, is also based on proxies. Turns out proxies are really good for setting up guardrails for how people use code, so if you can "prove" that users will write reasonably safe code, you can become more aggressive about state-management techniques. Vue's state model is better at surgical updates than say, React, because of the library's extensive use of Proxies (among other architectural innovations). Hope you found this response enlightening. Best wishes mate. - Oz.
@nathoud7166
@nathoud7166 3 жыл бұрын
very clear and understanbable 👍
@oleksandrparnekov1371
@oleksandrparnekov1371 Жыл бұрын
Good explanation. Thanks.
@abhishekmg2451
@abhishekmg2451 3 жыл бұрын
Awesome video !!! very clear
@dangerdoctor920
@dangerdoctor920 2 жыл бұрын
I wrote exactly like you did but it gives an error Uncaught TypeError: 'set' on proxy: trap returned falsish for property 'difficulty' on line 309
@jmmmmmmmmmk
@jmmmmmmmmmk 11 ай бұрын
Thx good video
@ashiqdey
@ashiqdey 2 жыл бұрын
awesome man
@intykatgames
@intykatgames 2 жыл бұрын
METATABLES IN JAVASCRIPT!!! HECK YEAHHHH
@jeetanshusrivastava2155
@jeetanshusrivastava2155 Жыл бұрын
Thanks!
@alex-dk2rj
@alex-dk2rj 2 жыл бұрын
Proxies underrated
@eren_korkmaz
@eren_korkmaz 2 жыл бұрын
best. thank you
@rafaelmrantunes
@rafaelmrantunes 3 жыл бұрын
Very nice video. Btw, which font is this?
@gatty.
@gatty. 3 жыл бұрын
Might be Open Sans
@dhruvshah7783
@dhruvshah7783 2 жыл бұрын
Nice!
@BroccoliColdbrew
@BroccoliColdbrew 10 ай бұрын
Like this video❤
@troooooper100
@troooooper100 4 жыл бұрын
why not just use class with private fields?
@erykczajkowski8226
@erykczajkowski8226 3 жыл бұрын
My guess is this proxy thingy seems to have more 'traps' than class, which has just two - set and get?
@اشکانمحمدی-ز1ث
@اشکانمحمدی-ز1ث 2 жыл бұрын
I believe that the use case demonstrated in this video was not a good example of a proxy. The real use case is when you want to perform some extra work behind the scenes that is not directly related to the object itself. For example you might want to save the game settings object in a SQL db, Redis cache, document cookies or local storage or etc... You might want to listen to the changes in the game settings properties and send them over an external API to sync the changes across the player's devices and so on and so forth ... None of these tasks are directly related to the gameSettings object. The purpose of the game settings object is to just represent the settings and control how you set or get them, it's not meant to have the implementation logic for syncing settings across devices or saving them to a storage. Proxies provide a better way to handle these situations
@FordExplorer-rm6ew
@FordExplorer-rm6ew 4 жыл бұрын
Where to store secrets? like a keys.js file?, ideal / best practices? For production mostly
@souravhemachandran5298
@souravhemachandran5298 3 жыл бұрын
Wow, guy just types with his mouse
@themovielookout
@themovielookout 4 жыл бұрын
First comment!!!👊🏿
@fatkhurohmana5937
@fatkhurohmana5937 8 ай бұрын
useImmer bring me here
Actual use case for JavaScript PROXY!
13:09
Kevin Ghadyani - JavaScript
Рет қаралды 14 М.
When you have a very capricious child 😂😘👍
00:16
Like Asiya
Рет қаралды 18 МЛН
Cat mode and a glass of water #family #humor #fun
00:22
Kotiki_Z
Рет қаралды 42 МЛН
Support each other🤝
00:31
ISSEI / いっせい
Рет қаралды 81 МЛН
How to use Generator Functions in JavaScript - Tutorial
18:47
Sending a form using the FormData object - JavaScript Tutorial
13:10
OpenJavaScript
Рет қаралды 42 М.
Why JavaScript Devs are Switching to Rust in 2024
10:35
warpdotdev
Рет қаралды 263 М.
JavaScript Proxy and Reflect Objects
18:10
Piyush Garg
Рет қаралды 10 М.
Дата и время в JavaScript. Урок по JS, Объект класса Date. UTC, GMT
1:14:37
ВебКадеми | Юрий Ключевский
Рет қаралды 16 М.
JavaScript Memory Leaks and How To Fix Them
14:58
Software Developer Diaries
Рет қаралды 30 М.
This is why JavaScript proxies are important
8:38
Web Dev Cody
Рет қаралды 15 М.
JavaScript Proxies
22:54
Steve Griffith - Prof3ssorSt3v3
Рет қаралды 11 М.
The Ultimate Guide to JavaScript Collections
24:52
Bran van der Meer
Рет қаралды 3,2 М.
When you have a very capricious child 😂😘👍
00:16
Like Asiya
Рет қаралды 18 МЛН