diff options
author | Steve Klebanoff <steve.klebanoff@gmail.com> | 2018-10-19 04:48:28 +0800 |
---|---|---|
committer | Steve Klebanoff <steve.klebanoff@gmail.com> | 2018-10-19 04:48:28 +0800 |
commit | b4af27dd4462a001904ac6d69e43aac9fd7bb69a (patch) | |
tree | 66f544254e240b93ce020990c25a7335897c7a12 /packages/instant/src/redux/reducer.ts | |
parent | 9aa67538231cc4ff71fd0f8ebe4dc66b1bcc4937 (diff) | |
download | dexon-sol-tools-b4af27dd4462a001904ac6d69e43aac9fd7bb69a.tar dexon-sol-tools-b4af27dd4462a001904ac6d69e43aac9fd7bb69a.tar.gz dexon-sol-tools-b4af27dd4462a001904ac6d69e43aac9fd7bb69a.tar.bz2 dexon-sol-tools-b4af27dd4462a001904ac6d69e43aac9fd7bb69a.tar.lz dexon-sol-tools-b4af27dd4462a001904ac6d69e43aac9fd7bb69a.tar.xz dexon-sol-tools-b4af27dd4462a001904ac6d69e43aac9fd7bb69a.tar.zst dexon-sol-tools-b4af27dd4462a001904ac6d69e43aac9fd7bb69a.zip |
Moved LatestErrorDisplay to types file and gave generic name
Diffstat (limited to 'packages/instant/src/redux/reducer.ts')
-rw-r--r-- | packages/instant/src/redux/reducer.ts | 16 |
1 files changed, 6 insertions, 10 deletions
diff --git a/packages/instant/src/redux/reducer.ts b/packages/instant/src/redux/reducer.ts index 6c278099f..2d50dd4b9 100644 --- a/packages/instant/src/redux/reducer.ts +++ b/packages/instant/src/redux/reducer.ts @@ -3,14 +3,10 @@ import { BigNumber } from '@0x/utils'; import * as _ from 'lodash'; import { zrxAssetData } from '../constants'; -import { AsyncProcessState } from '../types'; +import { AsyncProcessState, DisplayStatus } from '../types'; import { Action, ActionTypes } from './actions'; -export enum LatestErrorDisplay { - Present, - Hidden, -} export interface State { selectedAssetData?: string; selectedAssetAmount?: BigNumber; @@ -19,7 +15,7 @@ export interface State { latestBuyQuote?: BuyQuote; quoteRequestState: AsyncProcessState; latestError?: any; - latestErrorDisplay: LatestErrorDisplay; + latestErrorDisplay: DisplayStatus; } export const INITIAL_STATE: State = { @@ -30,7 +26,7 @@ export const INITIAL_STATE: State = { ethUsdPrice: undefined, latestBuyQuote: undefined, latestError: undefined, - latestErrorDisplay: LatestErrorDisplay.Hidden, + latestErrorDisplay: DisplayStatus.Hidden, quoteRequestState: AsyncProcessState.NONE, }; @@ -73,18 +69,18 @@ export const reducer = (state: State = INITIAL_STATE, action: Action): State => return { ...state, latestError: action.data, - latestErrorDisplay: LatestErrorDisplay.Present, + latestErrorDisplay: DisplayStatus.Present, }; case ActionTypes.HIDE_ERROR: return { ...state, - latestErrorDisplay: LatestErrorDisplay.Hidden, + latestErrorDisplay: DisplayStatus.Hidden, }; case ActionTypes.CLEAR_ERROR: return { ...state, latestError: undefined, - latestErrorDisplay: LatestErrorDisplay.Hidden, + latestErrorDisplay: DisplayStatus.Hidden, }; default: return state; |