~/talk

Falling in love with decorators ES6/TypeScript

Talkat JS Fest 2019 Autumn · 2019-11-08..11-09· [typescript, javascript]
slides:none on file

Demonstrates concrete decorator code in TypeScript: log decorator that wraps methods and prints args/results, a timer showing a 2.4s run reduced to near 0s after caching, a webworker decorator that offloads prime calculations and returns a promise or observable (works in demo but flagged as non‑production), a media-query decorator for Angular components, and a class decorator that validates constructor arity; notes that decorators transpile at compile time, evaluate bottom‑to‑top, and that bundle size can drop to ~1.2K in the simple example.

AI-written summary · about

  1. 0:00Start
  2. 4:05What decorators is?
  3. 4:29Disclaimer
  4. 5:28Proposal
  5. 7:23Common Use Cases
  6. 7:42Descriptor
  7. 10:38Class member Decorator (methods/properties)
  8. 12:00Signatures of the decorators
  9. 26:45Class Decorators
~/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.