Replies: 1 comment
-
I use it in merge-anything to merge objects and keep the correct types in a clean way: I have a couple more utilities like that that use ts-toolbelt. Including filter-anything which is an implementation of You don't need lodash, it's better practice and more fun if you create and host your own util functions and just use ts-toolbelt. for the types : ) |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Sorry for the broad, vague topic but I really don't know how else to narrow it.
I consider
ts-toolbelt
to be a master work. It has so much potential. Thank you @millsp!It's so often that I use some library, only to get half-assed types and think to myself "well, ts-toolbelt has types for that"...
My persistent problem is that powerful, correct typings are pointless if they aren't actually applied to concrete implementations. Libraries like
lodash
have half-assed types, but I wouldn't want to fork @types/lodash and reimplement all its types usingts-toolbelt
.At the same time, if our language primitives and basic utility classes aren't properly typed, then we'll just encounter friction everywhere else in a project.
So what's a dev to do?
My question to everyone is: how is everyone using
ts-toolbelt
in their projects...?Do you use
declare module
to re-type existing libraries?Do you fork existing libs and type them with ts-toolbelt?
Do you only use ts-toolbelt in your own libs, and just suffer with the other libs you use?
Do you only write/use your own libs with proper typings?
etc.
I'm genuinely interested to hear, and learn how my TS dev life could be improved.
Beta Was this translation helpful? Give feedback.
All reactions