MyCrypto/common/actions/rates/actionCreators.ts
William O'Beirne 1510533ec7 Equivalent values for all tokens (ETH + ERC20s) (#420)
* Fetch all token rates at once. Add option for displaying all token values.

* Ensure spinner always shows before equivalent values are ready.

* Fix up test.
2017-11-18 14:15:02 -06:00

29 lines
793 B
TypeScript

import * as interfaces from './actionTypes';
import { TypeKeys } from './constants';
import { fetchRates, CCResponse } from './actionPayloads';
export type TFetchCCRates = typeof fetchCCRates;
export function fetchCCRates(symbols: string[] = []): interfaces.FetchCCRates {
return {
type: TypeKeys.RATES_FETCH_CC,
payload: fetchRates(symbols)
};
}
export type TFetchCCRatesSucceeded = typeof fetchCCRatesSucceeded;
export function fetchCCRatesSucceeded(
payload: CCResponse
): interfaces.FetchCCRatesSucceeded {
return {
type: TypeKeys.RATES_FETCH_CC_SUCCEEDED,
payload
};
}
export type TFetchCCRatesFailed = typeof fetchCCRatesFailed;
export function fetchCCRatesFailed(): interfaces.FetchCCRatesFailed {
return {
type: TypeKeys.RATES_FETCH_CC_FAILED
};
}