Andrew Burgess
Andrew Burgess
  • 93
  • 919 105
How to use WeakMap and WeakSet in JavaScript
*My Links*
shaky.sh
shaky.sh/tools
andrew8088
mastodon.social/@andrew8088
#programming #coding #typescript #javascript #frontenddeveloper #backenddeveloper #softwareengineer #softwareengineering #softwaredevelopment #weakmap #weakset #expressjs
zhlédnutí: 3 138

Video

will i never understand this? unknown.
zhlédnutí 3,2KPřed 2 měsíci
i think I only said "covariance" when I meant "contravariance" once ... *My Links* shaky.sh shaky.sh/tools #programming #coding #typescript #javascript #covariance #contravariance #frontenddeveloper #backenddeveloper #softwareengineer #softwareengineering #softwaredevelopment
Responding to YOUR feedback about promise concurrency
zhlédnutí 2,4KPřed 4 měsíci
Thanks for all the great comments on my last video! *My Links* shaky.sh shaky.sh/tools
Managing Promise Concurrency in JavaScript
zhlédnutí 7KPřed 4 měsíci
Check out the code for this video here: gist.github.com/andrew8088/7ecdf23aab7412fe9c702f8ca0387768 *My Links* shaky.sh shaky.sh/tools #programming #coding #javascript #promises #concurrency #frontenddeveloper #backenddeveloper #softwareengineer #softwareengineering #softwaredevelopment
Disposable in TypeScript: Explicit Resource Management
zhlédnutí 1,8KPřed 5 měsíci
We got using/dispose aka explicit resource management in TypeScript 5.2. In this video, we look at a couple examples of how to use this tool in practice. - mock - 0:37 - object pool: - 4:25 - transaction - 10:55 Check out the code for this video here: github.com/andrew8088/ts-using-dispose-example *My Links* shaky.sh shaky.sh/tools andrew8088 mastodon.social/@andrew8088 #programming...
Advent of TypeScript Play-Through! Days 1 - 13
zhlédnutí 2,7KPřed 6 měsíci
Chapters - Day 1 - 0:46 - Day 2 - 1:50 - Day 3 - 2:40 - Day 4 - 3:34 - Day 5 - 5:00 - Day 6 - 7:18 - Day 7 - 11:01 - Day 8 - 14:58 - Day 9 - 17:19 - Day 10 - 21:52 - Day 11 - 23:30 - Day 12 - 28:16 - Day 13 - 33:29 - Conclusion - 46:52 Advent of TypeScript: typehero.dev/aot-2023 Distributive Conditional Types: shaky.sh/ts-distributive-conditional-types/ Thanks to @MichiganTypeScript for all the...
Advent of Code ... in Types Only!
zhlédnutí 2,9KPřed 6 měsíci
Check out the code for this video here: tsplay.dev/N5QZVN *My Links* shaky.sh shaky.sh/tools andrew8088 mastodon.social/@andrew8088 #programming #coding #typescript #javascript #adventofcode #frontenddeveloper #backenddeveloper #softwareengineer #softwareengineering #softwaredevelopment
old TypeScript syntax I just discovered
zhlédnutí 3,8KPřed 9 měsíci
This is an exceedingly nerdy dive into the topics of covariance and contravariance in TypeScript. Prefer to read about this topic? Read the accompanying blog post here: shaky.sh/ts-covariance-contravariance/ Check out the code for this video here: tsplay.dev/mqypYm *My Links* shaky.sh shaky.sh/tools andrew8088 mastodon.social/@andrew8088 #programming #coding #typescript #javascript ...
Syndication made simple! #ownyourdata
zhlédnutí 1,9KPřed 10 měsíci
X no longer marks the spot where I wanna be sharing thoughts ... github.com/andrew8088/pidge micro.blog 11ty.dev/ indieweb.org/POSSE *My Links* shaky.sh shaky.sh/notes andrew8088 mastodon.social/@andrew8088 micro.blog/shaky #posse #ownyourdata #vercel #mastodon #microblogging #twitter
Is functional programming worth it?
zhlédnutí 4,1KPřed 10 měsíci
I've been playing with functional programming and algebraic data types recently, and I'm not sure the trade offs are worth it. Code from the video: github.com/andrew8088/habits.sh *My Links* shaky.sh shaky.sh/tools andrew8088
5 Tips for Classier TypeScript
zhlédnutí 4,7KPřed 11 měsíci
If you're using classes a lot in your TypeScript code, here are several useful tips for you! 5 Tips 00:05 - Classes are both types and values 02:18 - Truly Private Fields 03:41 - Parameter Properties 04:36 - Assertions & Guards 07:07 - Handling the type of `this` *My Links* shaky.sh shaky.sh/tools andrew8088 mastodon.social/@andrew8088 #typescript #coding #programming #javascript #e...
TypeScript 5.2 new features review!
zhlédnutí 8KPřed 11 měsíci
The TypeScript 5.2 beta was announced a few days ago, and there are some pretty banger new features coming up! Let's take a quick look at what we'll getting soon. *My Links* shaky.sh shaky.sh/tools andrew8088 mastodon.social/@andrew8088 #typescript #coding #programming #javascript
How to use sed to automate big code changes (GUIs hate this trick)
zhlédnutí 6KPřed 11 měsíci
sed is a great command line tool for making code changes to codebases of any size. In this video, we'll look at several tips for quickly getting up and running with safely making these types of changes. The General Problem: xkcd.com/974/ *My Links* shaky.sh shaky.sh/tools andrew8088 mastodon.social/@andrew8088 #terminal #commandline
this regex identifies prime numbers (reaction)
zhlédnutí 113KPřed 11 měsíci
this regex identifies prime numbers (reaction)
How do closures work? (JavaScript Fundamentals, 2023)
zhlédnutí 6KPřed rokem
How do closures work? (JavaScript Fundamentals, 2023)
how to get better at typescript (feat. kysely)
zhlédnutí 7KPřed rokem
how to get better at typescript (feat. kysely)
Command Lines Scripts in JavaScript (or any language!)
zhlédnutí 4,6KPřed rokem
Command Lines Scripts in JavaScript (or any language!)
The Power of TypeScript Generics
zhlédnutí 6KPřed rokem
The Power of TypeScript Generics
Are your TypeScript Unions broken? | Advanced TypeScript
zhlédnutí 7KPřed rokem
Are your TypeScript Unions broken? | Advanced TypeScript
React Query tips from the maintainer @tkDodo
zhlédnutí 20KPřed rokem
React Query tips from the maintainer @tkDodo
I kinda hate hooks ... a refactoring story
zhlédnutí 7KPřed rokem
I kinda hate hooks ... a refactoring story
JavaScript’s Deferred Promise Pattern
zhlédnutí 12KPřed rokem
JavaScript’s Deferred Promise Pattern
TypeScript Transformations with Pick and Omit
zhlédnutí 3,4KPřed rokem
TypeScript Transformations with Pick and Omit
The TypeScript feature I never use
zhlédnutí 11KPřed rokem
The TypeScript feature I never use
5 JavaScript Tips You Probably Don't Know
zhlédnutí 9KPřed rokem
5 JavaScript Tips You Probably Don't Know
How does ts-reset work?
zhlédnutí 6KPřed rokem
How does ts-reset work?
A better way to use 3rd-part types (Extract & Exclude)
zhlédnutí 4,2KPřed rokem
A better way to use 3rd-part types (Extract & Exclude)
How does ZOD work? Build it yourself!
zhlédnutí 12KPřed rokem
How does ZOD work? Build it yourself!
i can't solve this in typescript
zhlédnutí 7KPřed rokem
i can't solve this in typescript
any vs unknown vs never: TypeScript demystified
zhlédnutí 20KPřed rokem
any vs unknown vs never: TypeScript demystified

Komentáře

  • @88goeth
    @88goeth Před 2 dny

    I totally agree with you, hooks are the worst thing that ever happened. I hate them... so now i hate React

  • @chookingvid
    @chookingvid Před 3 dny

    I prefer nested ternaries. They are not hard to read if formatted properly with line breaks and indents.

  • @brentmarquez9057
    @brentmarquez9057 Před 6 dny

    Can anyone point me to resources for adding node.js to a legacy javascript web app? (just script tags in html files).

  • @pgtechmedia5624
    @pgtechmedia5624 Před 8 dny

    Really helpful. Thanks

  • @chrishanthacosta4093

    Really smart teacher.

  • @fluxsiarski
    @fluxsiarski Před 14 dny

    Amazing!

  • @jaideepsingh8449
    @jaideepsingh8449 Před 20 dny

    Hey buddy, i saw your advent of typescript series, i am beginer, I got stuck in one of the similar code which uses advent of typescript logics, could you please help me out?

  • @jlecordier
    @jlecordier Před 21 dnem

    Unfortunately useless in legacy code with database queries and lots of side effects..

  • @user-pr7zo5lr7u
    @user-pr7zo5lr7u Před 23 dny

    To speed up, maybe: ps -e -o comm -t | grep nano | grep -v grep

  • @kcin4206
    @kcin4206 Před 23 dny

    Not many in-depth videos on this topic. Good video 👍

  • @wtl912
    @wtl912 Před 26 dny

    Excellent video, thanks a lot! Btw, it'd be great if you have the chance to add timestamps to your videos, it really helps a lot!

  • @returncode0000
    @returncode0000 Před 28 dny

    Could you please do more rust videos? Your rust videos are fantastic, especially the traits explanation 🔥

  • @ericb8494
    @ericb8494 Před 29 dny

    type TODO = any;

  • @pratik245
    @pratik245 Před měsícem

    In other languages like java, supertypes can always have reference to subtype instance. So string having referemce to a role is not surprising but has a different name calles contravariance in typescript.

  • @tech_channel110
    @tech_channel110 Před měsícem

    well defined

  • @zxyi9090
    @zxyi9090 Před měsícem

    The way I think about FP is like a point free data pipeline. Also would recommend ramda or lodash

  • @vendiddy
    @vendiddy Před měsícem

    This was very illuminating! In a similar vein I'd love to understand how something like ts-pattern works under the hood. Like how to implement a mini pattern-matching library.

  • @DV-ml4fm
    @DV-ml4fm Před měsícem

    I used crontab to run a command and output the result it to a file. Then I create a custom command to read the file with detect_files option.

  • @NazarPashazade
    @NazarPashazade Před měsícem

    Great explanation. Big Thanks!

  • @Samonitari
    @Samonitari Před měsícem

    At this point, you could just throw out zsh, one less sh*t to maintain, I definitely did left zsh and never looked back! I always hated the bazillion frikin' knobs to tweak, and the whole oh-my-zsh project. I mean why do I have to have a plugin manager for my shell? Luckily starship is quite cross-shell! On a similar note, I left nvim for helix. Unfortunately I cannot install it to all of our servers. But the environment on the workstations I use have become leaner, and less of a beautiful-only-for-me-and-brittle-AF snowflakes...

  • @mrlectus
    @mrlectus Před měsícem

    does this mean i have to move every config from .config to dotfile and then symlink them back to .config?

  • @duke605
    @duke605 Před měsícem

    Just no

  • @SamsungA04e-dp7kj
    @SamsungA04e-dp7kj Před měsícem

    1.Global Positioning System 2.Undefined 3.Kalkulator 4.Rudi Harmanto

  • @superhero-studios
    @superhero-studios Před měsícem

    For clearing terminals, I always use CMD+K. Though `c` is one less keystroke.

  • @adammontgomery7980
    @adammontgomery7980 Před měsícem

    For some reason I really like rust when watching someone write and explain it. When I try to write it, everything becomes...hectic. Isn't ParseError an error enum that you could extend with ParseEquationError?

  • @joel_bio
    @joel_bio Před měsícem

    Fantastic perspective

  • @schizomaru
    @schizomaru Před měsícem

    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 Před měsícem

      In this video he is using nodejs timers/promises which is a promisified version ofr the global setTimeout

  • @Ali-sc6dh
    @Ali-sc6dh Před 2 měsíci

    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

  • @malvoliosf
    @malvoliosf Před 2 měsíci

    There is a huge bug in your code! The results are returned in the order they were resolved, NOT the order they appeared in the original args array. Make a function that has the functionality “given n, wait 10-n seconds then return n” and run it with an array 0 through 9 and a concurrency of 10. The numbers will be returned in reverse order.

  • @aredrih6723
    @aredrih6723 Před 2 měsíci

    Another strength is that v8 jit smile on function that take arguments of consistent shape. Weak collection allows you to add extra data to objects without changing their shapes. That said, voodoo practice to please the jit happy can get cargo cultish.

  • @xelspeth
    @xelspeth Před 2 měsíci

    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?

  • @florianbopp187
    @florianbopp187 Před 2 měsíci

    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 Před 2 měsíci

      i was about to point exactly the same reference from vue reactivity

  • @ivan.romaniv
    @ivan.romaniv Před 2 měsíci

    that's really nice example! thank you!

  • @hugodsa89
    @hugodsa89 Před 2 měsíci

    Audio is top. Maybe don’t lean back 🤣

  • @hugodsa89
    @hugodsa89 Před 2 měsíci

    Missed your videos

  • @afuzzybearsyoutubechannel2812

    💚

  • @lenaggar
    @lenaggar Před 2 měsíci

    first of all YES! second, I have a comment on the implementation, there's a possibility (in the case that the concurrency limit is 3) that either one of or both of the 2 jobs before the last one finish after the last one does; in this case the returned results list will have their corresponding values in the results array as undefined, and also callback will be called more than one time. possible solutions I could think of: 1- do a filter operation on existence of values before checking for equality with the inputs array length; else if (results.filter(Boolean).length == inputs.length) 2- use a Map keys as the index of the result in the array and values as the result; verify using map.size rather than results.length; then when you finally resolve, you can map it into an array again

    • @lenaggar
      @lenaggar Před 2 měsíci

      Oh! I just watched your next video, your solution using the `settled` counter is much simpler. Thank you for that one <3

  • @evccyr
    @evccyr Před 2 měsíci

    Honestly typescript doesn't really give any feel of a strongly typed language. It also adds to the complexity.

    • @andrew-burgess
      @andrew-burgess Před 2 měsíci

      Ooh, that's a take I haven't heard before: that TS isn't strongly-typed. Say more?

  • @0bsy96
    @0bsy96 Před 2 měsíci

    Thanks so much , you just saved me a lot of typeguard checks!

  • @juniomilnovecientos
    @juniomilnovecientos Před 2 měsíci

    your alternative became even better with typescript declaration merging which allows us to use the same name for the value and type

  • @AlexanderYaremchuk
    @AlexanderYaremchuk Před 2 měsíci

    One thought I got - function is a worker. Input - is a field which is cultivated by him. Output - checks to be paid returned by the worker. so we can substitute a worker with another worker who cultivates same or bigger field and returns same or narrower amount of checks.

  • @jessejoseph2643
    @jessejoseph2643 Před 2 měsíci

    This guy has just complicated the whole concept of generics. Anyone who really wants to wrap their head around generics should go over to web dev simplified czcams.com/video/EcCTIExsqmI/video.html. You are welcome.

  • @lacherolachero9409
    @lacherolachero9409 Před 2 měsíci

    Absolutely gold

  • @gordonfreimann
    @gordonfreimann Před 2 měsíci

    Yikes. What a nightmare this language is. God i feel good writing Go

  • @ashleyredman
    @ashleyredman Před 2 měsíci

    That was a great video, and the moving box example landed it for me perfectly

  • @spead
    @spead Před 2 měsíci

    Great video! Difficult concept explained intuitively.

  • @PyroVox
    @PyroVox Před 2 měsíci

    Thanks so much for making this video. Having grappled with this exact issue when trying to use generics in TypeScript, your explanation of covariance and contravariance and the moving box example are the best I've come across yet. I still don't *fully* understand the mechanism, at least enough to be able to explain it to someone else as well as you do in this video, but my internal understanding is much improved. I'd love to see more videos like this where you dive into similar problems in TypeScript and maybe even other languages.

  • @GHOST8799
    @GHOST8799 Před 2 měsíci

    Huh I wonder if the concept of covariant and contravariants apply when dealing with function overloads? Specifically in how we create function overloads

  • @BradySie-wo6vf
    @BradySie-wo6vf Před 2 měsíci

    another possible helpful way of thinking about it is if you flatten the passed function and inline it, you're expecting to pass it a Role, so if the actual function expects a string then of course a Role can be passed into the string

  • @michaelns9887
    @michaelns9887 Před 2 měsíci

    It would be also easier to understand if we add an implementation to `registerUser` function registerUser(greetFn: (names: string) => void) { greetFn("John") } This is completely correct. But if `greetFn` is `greetUser` - then it will break, because it can only accept Role.