How to use WeakMap and WeakSet in JavaScript

  Рет қаралды 5,016

Andrew Burgess

Andrew Burgess

Күн бұрын

Пікірлер: 12
@florianbopp187
@florianbopp187 8 ай бұрын
Another place where a weakmap is useful is for diy reactivity using proxies. You can use it to store reactivity dependencies and they will be garbage collected when the dependencies are. See vue‘s reactivity system for more info.
@studiowebselect
@studiowebselect 8 ай бұрын
i was about to point exactly the same reference from vue reactivity
@hugodsa89
@hugodsa89 8 ай бұрын
Missed your videos
@ivan.romaniv
@ivan.romaniv 8 ай бұрын
that's really nice example! thank you!
@PickleRiiiiiiick
@PickleRiiiiiiick 4 ай бұрын
Very nice.
@Ali-sc6dh
@Ali-sc6dh 8 ай бұрын
I used weekmap a lot for analytics data tracking. In case you want to build a tracking tool that is independant from the website source code, you can use weakmap to track for exemple unique impressions of elements (when they are visible on screen). This way you don't hold references to HTML elements that have been removed from the DOM and prevent them from being garbage collected
@xelspeth
@xelspeth 8 ай бұрын
Great video didn't even know this was a thing! What do you use to get curly if's and else's? Or is that just manual nvim config?
@andrew-burgess
@andrew-burgess 8 ай бұрын
That's the font I use, mono lisa
@hugodsa89
@hugodsa89 8 ай бұрын
Audio is top. Maybe don’t lean back 🤣
@schizomaru
@schizomaru 8 ай бұрын
line 33: await setTimeout...? i dont think setTimeout returns a promise you could create: function delay(time){return new Promise((done)=>{setTimeout(done, time || 0});} await delay(1000 * Math.random());
@EccentricEngineerMN
@EccentricEngineerMN 8 ай бұрын
In this video he is using nodejs timers/promises which is a promisified version ofr the global setTimeout
An array of ways ... to create arrays (JS Basics)
11:04
Andrew Burgess
Рет қаралды 1,9 М.
TypeScript Challenge: What's *this* all about?
9:49
Andrew Burgess
Рет қаралды 4,8 М.
coco在求救? #小丑 #天使 #shorts
00:29
好人小丑
Рет қаралды 120 МЛН
Support each other🤝
00:31
ISSEI / いっせい
Рет қаралды 81 МЛН
黑天使被操控了#short #angel #clown
00:40
Super Beauty team
Рет қаралды 61 МЛН
#8 Type Conversion & Coercion in JavaScript
12:53
Telusko
Рет қаралды 138 М.
Managing Promise Concurrency in JavaScript
12:44
Andrew Burgess
Рет қаралды 8 М.
Weak References, Reachability, WeakSets, and WeakMaps
15:54
Steve Griffith - Prof3ssorSt3v3
Рет қаралды 4,1 М.
The TypeScript feature I never use
10:49
Andrew Burgess
Рет қаралды 12 М.
What's new in shadcn 2.0
18:48
Matt Palmer
Рет қаралды 2,2 М.
Welcome to Async Generators in JavaScript
10:53
Andrew Burgess
Рет қаралды 6 М.
will i never understand this? unknown.
12:05
Andrew Burgess
Рет қаралды 4 М.
JavaScript Error Handling: 5 Things You Aren’t Thinking About!
14:42
old TypeScript syntax I just discovered
8:54
Andrew Burgess
Рет қаралды 4,2 М.
What are JavaScript Generators and Iterators?
10:28
Andrew Burgess
Рет қаралды 7 М.