score:2

Accepted answer

I was able to get around that error by adding in a converter.ts util, however if there is a better answer please post for points!

// ACTIONS

export const startGetPrices = () => (dispatch: any) => getLatest().then((res) => {
  const ratesArray = converters.ratesIntoArray(res);
  dispatch(actionGetPrices(ratesArray));
});

// utils/converters.ts

// Takes rates { key : value } pairs and converts into Array.
export const ratesIntoArray = ({ data: { rates } }: any) =>
  Object.keys(rates).map(data => [data, rates[data]]);

Related Query

More Query from same tag