/ common / features / rates / actions.ts
actions.ts
 1  import { CCResponse } from 'api/rates';
 2  import * as types from './types';
 3  
 4  export type TFetchCCRatesRequested = typeof fetchCCRatesRequested;
 5  export function fetchCCRatesRequested(symbols: string[] = []): types.FetchCCRatesRequested {
 6    return {
 7      type: types.RatesActions.CC_REQUESTED,
 8      payload: symbols
 9    };
10  }
11  
12  export type TFetchCCRatesSucceeded = typeof fetchCCRatesSucceeded;
13  export function fetchCCRatesSucceeded(payload: CCResponse): types.FetchCCRatesSucceeded {
14    return {
15      type: types.RatesActions.CC_SUCCEEDED,
16      payload
17    };
18  }
19  
20  export type TFetchCCRatesFailed = typeof fetchCCRatesFailed;
21  export function fetchCCRatesFailed(): types.FetchCCRatesFailed {
22    return {
23      type: types.RatesActions.CC_FAILED
24    };
25  }