Тёмный

A Practical Guide to JavaScript Proxy Objects 

TomDoesTech
Подписаться 29 тыс.
Просмотров 6 тыс.
50% 1

Have you ever wondered what proxies are in JavaScript and what you can use them for? In this video, we take a look at Proxy Objects in JavaScript. We start off by creating our own implementation of the proxy, then dive into a practical application for proxies.
🌎 Follow me here:
Discord: / discord
Twitter: / tomdoes_tech
Facebook: / tomdoestech​
Instagram: / tomdoestech​
TikTok: / tomdoes_tech
☕ Buy me a coffee: www.buymeacoffee.com/tomn

Опубликовано:

 

24 янв 2022

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 14   
@Dave-dl8ey
@Dave-dl8ey Год назад
Tom you always have great content. Came across JS Proxy today and needed to understand it. Checked a few videos but this was the best. Tom always saves the day!
@Corzhy0
@Corzhy0 2 года назад
This guy is a legend
@prozacgod
@prozacgod Год назад
naming the proxy getCharacter is kinda rough, it really undermines the understanding. Calling it "characterProxy" would make vastly more sense, esp. as you expand the functionality of the proxy. Secondly, it may be a matter of form, but I would always use target instead of the original object when using the proxy. I think proxies are recursive, so you can proxy a proxy etc... one of your implementations refered to the original object directly, bypassing future flexibility. all-in-all a decent run through, with just those minor nit picks.
@TomDoesTech
@TomDoesTech Год назад
Thanks for the feedback!
@kashnigahbaruda
@kashnigahbaruda 2 года назад
Nice!
@hermana1016
@hermana1016 Год назад
Good video, nice to here an Australian voice instead of always American voices
@8koi245
@8koi245 Год назад
13:17 don't need the Boolean just to wrap it in ( )
@matecode359
@matecode359 Год назад
Thank u for this guide, tho i have a question. Why write 'complicated' proxy obj instead of a function which will check if an item with ID passed to our fetch function already exists in our cache? and just return if it does?
@TomDoesTech
@TomDoesTech Год назад
Because the video was about proxy objects
@SachinYadav-eh7vg
@SachinYadav-eh7vg Год назад
This is a good explanation thanks for that, but why would be one using this approach of getter and setter isn't this approach more relevant towards object oriented whereas JS is functional ?
@alexanderdiakonov1340
@alexanderdiakonov1340 Год назад
How you set the value , if handler dosent have the set mothod... ??? 😵‍💫
@dodv6
@dodv6 Год назад
well character is set into characterCache while you fetch data from the server itself you can see the code
@And1997Ruz
@And1997Ruz 9 месяцев назад
This is actually bad Don't recommend watching it, you'll ruin your understanding of the purpose of proxies Great channel overall, but this video is bad I'm sorry
@supremoluminary
@supremoluminary Год назад
All you need to get the `in` operator working is the grouping operator. if( !(1 in getCharacter)) { } It is not the case that:- if( !1 in getCharacter) - is falsey all the time. `!1` is converted ToBoolean to false. Thus, the expression is literally evaluated as:- if(false in getCharacter) - and, given that id's are numeric here, `false in getCharacter` will literally be false all the time.
Далее
Actual use case for JavaScript PROXY!
13:09
Просмотров 11 тыс.
Вечный ДВИГАТЕЛЬ!⚙️ #shorts
00:27
Просмотров 2,1 млн
JavaScript Proxies
22:54
Просмотров 11 тыс.
Testing Express REST API With Jest & Supertest
55:46
Просмотров 114 тыс.
Why JavaScript Devs are Switching to Rust in 2024
10:35
TypeScript Wizardry: Recursive Template Literals
14:47
5 JavaScript Concepts You HAVE TO KNOW
9:38
Просмотров 1,4 млн
Use Maps more and Objects less
5:45
Просмотров 87 тыс.
Вечный ДВИГАТЕЛЬ!⚙️ #shorts
00:27
Просмотров 2,1 млн