~/talk

Usefulness and Uses of Weak Reference and Finalization Registry in Real Life

Talkat HalfStack Vienna 2023 · on Friday, 2023-09-15· [javascript, web-platform]
links:none on file
slides:none on file

Shows how to build a weak-value cache using a Map from image names to WeakRef objects and a FinalizationRegistry that deletes map keys when targets are collected; code returns a memoized loader that calls ref() and regenerates images on miss, and registers entries after inserting them. Demo is a photo-collage app that first downloads four images, later serves 3 of 4 from cache (75% fewer network requests); warns that cleanup relies on nondeterministic GC and finalizers are not guaranteed to run.

AI-written summary · about

  1. 0:00Introduction to features
  2. 2:02Understanding WeakRef
  3. 5:06WeakRef implementation
  4. 8:11Using finalizers
  5. 9:34Combined usage
  6. 11:11Practical application
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.