Menu

#SubClassIng

1 post

Feed
1 of 1 post
Decorating a Promise with convenience methods at runtime without subclassing or Proxy
📰
0Read More

Decorating a Promise with convenience methods at runtime without subclassing or Proxy

Reddit r/typescript·u/OtherwisePush6424·7 months ago
#lyectZrE

How to attach optional methods like .json() and .text() directly to a Promise instance using property descriptors, a Symbol-based idempotency guard, and an intersection type, without changing what await returns, without subclassing, and without a Proxy…

15s