How to use WeakMap and WeakSet in JavaScript

  Рет қаралды 4,654

Andrew Burgess

Andrew Burgess

Күн бұрын

Пікірлер: 12
@florianbopp187
@florianbopp187 6 ай бұрын
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 6 ай бұрын
i was about to point exactly the same reference from vue reactivity
@hugodsa89
@hugodsa89 6 ай бұрын
Missed your videos
@ivan.romaniv
@ivan.romaniv 6 ай бұрын
that's really nice example! thank you!
@PickleRiiiiiiick
@PickleRiiiiiiick 3 ай бұрын
Very nice.
@xelspeth
@xelspeth 6 ай бұрын
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 6 ай бұрын
That's the font I use, mono lisa
@Ali-sc6dh
@Ali-sc6dh 6 ай бұрын
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
@hugodsa89
@hugodsa89 6 ай бұрын
Audio is top. Maybe don’t lean back 🤣
@schizomaru
@schizomaru 6 ай бұрын
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 6 ай бұрын
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,8 М.
Managing Promise Concurrency in JavaScript
12:44
Andrew Burgess
Рет қаралды 8 М.
小丑揭穿坏人的阴谋 #小丑 #天使 #shorts
00:35
好人小丑
Рет қаралды 40 МЛН
Wait for the last one 🤣🤣 #shorts #minecraft
00:28
Cosmo Guy
Рет қаралды 25 МЛН
World’s strongest WOMAN vs regular GIRLS
00:56
A4
Рет қаралды 21 МЛН
old TypeScript syntax I just discovered
8:54
Andrew Burgess
Рет қаралды 4,1 М.
Weak References, Reachability, WeakSets, and WeakMaps
15:54
Steve Griffith - Prof3ssorSt3v3
Рет қаралды 3,9 М.
Building Fluent Interfaces in TypeScript
16:15
Andrew Burgess
Рет қаралды 16 М.
Mastering Memory Management in Node.js: Tips and Tricks for Better Performance
16:06
Software Developer Diaries
Рет қаралды 36 М.
any vs unknown vs never: TypeScript demystified
8:01
Andrew Burgess
Рет қаралды 24 М.
will i never understand this? unknown.
12:05
Andrew Burgess
Рет қаралды 3,8 М.
Are your TypeScript Unions broken? | Advanced TypeScript
7:36
Andrew Burgess
Рет қаралды 8 М.
Finally Fix Your Issues With JS/React Memory Management 😤
20:13
Jack Herrington
Рет қаралды 87 М.
JavaScript Visualized - Event Loop, Web APIs, (Micro)task Queue
12:35
小丑揭穿坏人的阴谋 #小丑 #天使 #shorts
00:35
好人小丑
Рет қаралды 40 МЛН