Typescript – Infering Rtk query hook returned data type
I am creating a function “useGetPreviousPeriodData” that takes as argument a list of query functions, and returns a list of same length containing the returned data of those input functions.
For this specific case the query functions are Rtk query hooks. So the input functions types are well defined.