2017-09-25 02:06:28 +00:00
|
|
|
import * as interfaces from './actionTypes';
|
|
|
|
import { TypeKeys } from './constants';
|
2017-11-17 21:12:27 +00:00
|
|
|
import { fetchRates, CCResponse } from './actionPayloads';
|
2017-09-25 02:06:28 +00:00
|
|
|
|
2017-09-26 03:41:11 +00:00
|
|
|
export type TFetchCCRates = typeof fetchCCRates;
|
2017-11-15 05:51:09 +00:00
|
|
|
export function fetchCCRates(symbol: string): interfaces.FetchCCRates {
|
2017-09-25 02:06:28 +00:00
|
|
|
return {
|
2017-09-26 03:41:11 +00:00
|
|
|
type: TypeKeys.RATES_FETCH_CC,
|
2017-11-15 05:51:09 +00:00
|
|
|
payload: fetchRates(symbol)
|
2017-09-25 02:06:28 +00:00
|
|
|
};
|
|
|
|
}
|
2017-11-17 21:12:27 +00:00
|
|
|
|
|
|
|
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
|
|
|
|
};
|
|
|
|
}
|