You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've been looking through the documentation for a while but am unable to find the answer to this problem. Perhaps I am missing something, so apologies!
I woud like to extract T[ ] => T (get an object type from array).
Without TS Toolbelt I have been doing it like const x: T = T[number] (as described here) but wonder if there is a utility provided by tsbelt for the same purpose. Thank you!
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hello!
I've been looking through the documentation for a while but am unable to find the answer to this problem. Perhaps I am missing something, so apologies!
I woud like to extract T[ ] => T (get an object type from array).
Without TS Toolbelt I have been doing it like
const x: T = T[number]
(as described here) but wonder if there is a utility provided by tsbelt for the same purpose. Thank you!Beta Was this translation helpful? Give feedback.
All reactions