This ends up in most of my projects: type Dict<T> = { [key: string]: T }
-
-
-
Ohhh I like this. I could also just shove it in a typelib if I'm too lazy to import it (which I am).
- 7 more replies
New conversation -
-
-
TypeScript has Record<KeyType, ValueType>. So here it would be Record<string, any>. Works with string unions too.
- 1 more reply
New conversation -
-
-
That’ll be awesome! I think that everyone has the same experience at least once
Thanks. Twitter will use this to make your timeline better. UndoUndo
-
-
-
Type alias? Also for TS, use `{ [key: string]: unknown }`.
Thanks. Twitter will use this to make your timeline better. UndoUndo
-
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.
he/him 