|
|
|
|
|
by hmsimha
1403 days ago
|
|
Perhaps the React-Query source itself is a good example of when "simple" is still not "easy to read/write": I picked out this file pretty arbitrarily: https://github.com/TanStack/query/blob/main/packages/react-q... The author of react-query seems to be very clear at communicating how the library works and the library itself provides a great developer experience, but it's also an example of how much work can go into correct typing in library code. |
|
An example from the docs with middleware:
https://docs.pmnd.rs/zustand/typescript#middleware-that-chan...
If anyone calls this “easy, just learn generics” I won’t believe them further.