From 2041e9945edf6f5255185de73c0dc332270e4bbb Mon Sep 17 00:00:00 2001 From: Leonid Logvinov Date: Fri, 15 Dec 2017 15:19:19 +0100 Subject: Fix website unused vars --- packages/website/ts/redux/dispatcher.ts | 1 - 1 file changed, 1 deletion(-) (limited to 'packages/website/ts/redux/dispatcher.ts') diff --git a/packages/website/ts/redux/dispatcher.ts b/packages/website/ts/redux/dispatcher.ts index a0a1da21b..cbcee6599 100644 --- a/packages/website/ts/redux/dispatcher.ts +++ b/packages/website/ts/redux/dispatcher.ts @@ -6,7 +6,6 @@ import { AssetToken, BlockchainErrs, Direction, - Fill, Order, ProviderType, ScreenWidths, -- cgit v1.2.3 From 449fd9f0242b031c7427ae9a95430008c3171d1c Mon Sep 17 00:00:00 2001 From: Fabio Berger Date: Sun, 17 Dec 2017 19:38:59 -0500 Subject: Remove unused enums --- packages/website/ts/redux/dispatcher.ts | 7 ------- 1 file changed, 7 deletions(-) (limited to 'packages/website/ts/redux/dispatcher.ts') diff --git a/packages/website/ts/redux/dispatcher.ts b/packages/website/ts/redux/dispatcher.ts index cbcee6599..e37e1fa6c 100644 --- a/packages/website/ts/redux/dispatcher.ts +++ b/packages/website/ts/redux/dispatcher.ts @@ -5,7 +5,6 @@ import { ActionTypes, AssetToken, BlockchainErrs, - Direction, Order, ProviderType, ScreenWidths, @@ -43,12 +42,6 @@ export class Dispatcher { type: ActionTypes.SWAP_ASSET_TOKENS, }); } - public updateGenerateOrderStep(direction: Direction) { - this.dispatch({ - data: direction, - type: ActionTypes.UPDATE_GENERATE_ORDER_STEP, - }); - } public updateOrderSalt(salt: BigNumber) { this.dispatch({ data: salt, -- cgit v1.2.3 From 90d274ffc4cce36c1ff572fad10bd7896e255ada Mon Sep 17 00:00:00 2001 From: Fabio Berger Date: Sun, 17 Dec 2017 20:06:49 -0500 Subject: Update ActionType enum and move from using _.assign in reducer --- packages/website/ts/redux/dispatcher.ts | 66 ++++++++++++++++----------------- 1 file changed, 33 insertions(+), 33 deletions(-) (limited to 'packages/website/ts/redux/dispatcher.ts') diff --git a/packages/website/ts/redux/dispatcher.ts b/packages/website/ts/redux/dispatcher.ts index e37e1fa6c..ad5553c58 100644 --- a/packages/website/ts/redux/dispatcher.ts +++ b/packages/website/ts/redux/dispatcher.ts @@ -22,42 +22,42 @@ export class Dispatcher { // Portal public resetState() { this.dispatch({ - type: ActionTypes.RESET_STATE, + type: ActionTypes.ResetState, }); } public updateNodeVersion(nodeVersion: string) { this.dispatch({ data: nodeVersion, - type: ActionTypes.UPDATE_NODE_VERSION, + type: ActionTypes.UpdateNodeVersion, }); } public updateScreenWidth(screenWidth: ScreenWidths) { this.dispatch({ data: screenWidth, - type: ActionTypes.UPDATE_SCREEN_WIDTH, + type: ActionTypes.UpdateScreenWidth, }); } public swapAssetTokenSymbols() { this.dispatch({ - type: ActionTypes.SWAP_ASSET_TOKENS, + type: ActionTypes.SwapAssetTokens, }); } public updateOrderSalt(salt: BigNumber) { this.dispatch({ data: salt, - type: ActionTypes.UPDATE_ORDER_SALT, + type: ActionTypes.UpdateOrderSalt, }); } public updateUserSuppliedOrderCache(order: Order) { this.dispatch({ data: order, - type: ActionTypes.UPDATE_USER_SUPPLIED_ORDER_CACHE, + type: ActionTypes.UpdateUserSuppliedOrderCache, }); } public updateShouldBlockchainErrDialogBeOpen(shouldBeOpen: boolean) { this.dispatch({ data: shouldBeOpen, - type: ActionTypes.UPDATE_SHOULD_BLOCKCHAIN_ERR_DIALOG_BE_OPEN, + type: ActionTypes.UpdateShouldBlockchainErrDialogBeOpen, }); } public updateChosenAssetToken(side: Side, token: AssetToken) { @@ -66,7 +66,7 @@ export class Dispatcher { side, token, }, - type: ActionTypes.UPDATE_CHOSEN_ASSET_TOKEN, + type: ActionTypes.UpdateChosenAssetToken, }); } public updateChosenAssetTokenAddress(side: Side, address: string) { @@ -75,72 +75,72 @@ export class Dispatcher { address, side, }, - type: ActionTypes.UPDATE_CHOSEN_ASSET_TOKEN_ADDRESS, + type: ActionTypes.UpdateChosenAssetTokenAddress, }); } public updateOrderTakerAddress(address: string) { this.dispatch({ data: address, - type: ActionTypes.UPDATE_ORDER_TAKER_ADDRESS, + type: ActionTypes.UpdateOrderTakerAddress, }); } public updateUserAddress(address: string) { this.dispatch({ data: address, - type: ActionTypes.UPDATE_USER_ADDRESS, + type: ActionTypes.UpdateUserAddress, }); } public updateOrderExpiry(unixTimestampSec: BigNumber) { this.dispatch({ data: unixTimestampSec, - type: ActionTypes.UPDATE_ORDER_EXPIRY, + type: ActionTypes.UpdateOrderExpiry, }); } public encounteredBlockchainError(err: BlockchainErrs) { this.dispatch({ data: err, - type: ActionTypes.BLOCKCHAIN_ERR_ENCOUNTERED, + type: ActionTypes.BlockchainErrEncountered, }); } public updateBlockchainIsLoaded(isLoaded: boolean) { this.dispatch({ data: isLoaded, - type: ActionTypes.UPDATE_BLOCKCHAIN_IS_LOADED, + type: ActionTypes.UpdateBlockchainIsLoaded, }); } public addTokenToTokenByAddress(token: Token) { this.dispatch({ data: token, - type: ActionTypes.ADD_TOKEN_TO_TOKEN_BY_ADDRESS, + type: ActionTypes.AddTokenToTokenByAddress, }); } public removeTokenToTokenByAddress(token: Token) { this.dispatch({ data: token, - type: ActionTypes.REMOVE_TOKEN_TO_TOKEN_BY_ADDRESS, + type: ActionTypes.RemoveTokenFromTokenByAddress, }); } public clearTokenByAddress() { this.dispatch({ - type: ActionTypes.CLEAR_TOKEN_BY_ADDRESS, + type: ActionTypes.ClearTokenByAddress, }); } public updateTokenByAddress(tokens: Token[]) { this.dispatch({ data: tokens, - type: ActionTypes.UPDATE_TOKEN_BY_ADDRESS, + type: ActionTypes.UpdateTokenByAddress, }); } public updateTokenStateByAddress(tokenStateByAddress: TokenStateByAddress) { this.dispatch({ data: tokenStateByAddress, - type: ActionTypes.UPDATE_TOKEN_STATE_BY_ADDRESS, + type: ActionTypes.UpdateTokenStateByAddress, }); } public removeFromTokenStateByAddress(tokenAddress: string) { this.dispatch({ data: tokenAddress, - type: ActionTypes.REMOVE_FROM_TOKEN_STATE_BY_ADDRESS, + type: ActionTypes.RemoveFromTokenStateByAddress, }); } public replaceTokenAllowanceByAddress(address: string, allowance: BigNumber) { @@ -149,7 +149,7 @@ export class Dispatcher { address, allowance, }, - type: ActionTypes.REPLACE_TOKEN_ALLOWANCE_BY_ADDRESS, + type: ActionTypes.ReplaceTokenAllowanceByAddress, }); } public replaceTokenBalanceByAddress(address: string, balance: BigNumber) { @@ -158,7 +158,7 @@ export class Dispatcher { address, balance, }, - type: ActionTypes.REPLACE_TOKEN_BALANCE_BY_ADDRESS, + type: ActionTypes.ReplaceTokenBalanceByAddress, }); } public updateTokenBalanceByAddress(address: string, balanceDelta: BigNumber) { @@ -167,31 +167,31 @@ export class Dispatcher { address, balanceDelta, }, - type: ActionTypes.UPDATE_TOKEN_BALANCE_BY_ADDRESS, + type: ActionTypes.UpdateTokenBalanceByAddress, }); } public updateSignatureData(signatureData: SignatureData) { this.dispatch({ data: signatureData, - type: ActionTypes.UPDATE_ORDER_SIGNATURE_DATA, + type: ActionTypes.UpdateOrderSignatureData, }); } public updateUserEtherBalance(balance: BigNumber) { this.dispatch({ data: balance, - type: ActionTypes.UPDATE_USER_ETHER_BALANCE, + type: ActionTypes.UpdateUserEtherBalance, }); } public updateNetworkId(networkId: number) { this.dispatch({ data: networkId, - type: ActionTypes.UPDATE_NETWORK_ID, + type: ActionTypes.UpdateNetworkId, }); } public updateOrderFillAmount(amount: BigNumber) { this.dispatch({ data: amount, - type: ActionTypes.UPDATE_ORDER_FILL_AMOUNT, + type: ActionTypes.UpdateOrderFillAmount, }); } @@ -199,13 +199,13 @@ export class Dispatcher { public updateCurrentDocsVersion(version: string) { this.dispatch({ data: version, - type: ActionTypes.UPDATE_LIBRARY_VERSION, + type: ActionTypes.UpdateLibraryVersion, }); } public updateAvailableDocVersions(versions: string[]) { this.dispatch({ data: versions, - type: ActionTypes.UPDATE_AVAILABLE_LIBRARY_VERSIONS, + type: ActionTypes.UpdateAvailableLibraryVersions, }); } @@ -213,23 +213,23 @@ export class Dispatcher { public showFlashMessage(msg: string|React.ReactNode) { this.dispatch({ data: msg, - type: ActionTypes.SHOW_FLASH_MESSAGE, + type: ActionTypes.ShowFlashMessage, }); } public hideFlashMessage() { this.dispatch({ - type: ActionTypes.HIDE_FLASH_MESSAGE, + type: ActionTypes.HideFlashMessage, }); } public updateProviderType(providerType: ProviderType) { this.dispatch({ - type: ActionTypes.UPDATE_PROVIDER_TYPE, + type: ActionTypes.UpdateProviderType, data: providerType, }); } public updateInjectedProviderName(injectedProviderName: string) { this.dispatch({ - type: ActionTypes.UPDATE_INJECTED_PROVIDER_NAME, + type: ActionTypes.UpdateInjectedProviderName, data: injectedProviderName, }); } -- cgit v1.2.3 From cb11aec84df346d5180c7d5874859c1c34f0bf1c Mon Sep 17 00:00:00 2001 From: Brandon Millman Date: Wed, 20 Dec 2017 00:44:08 -0500 Subject: Add new underscore-privates rule to @0xproject/tslint-config and fix lint errors --- packages/website/ts/redux/dispatcher.ts | 70 ++++++++++++++++----------------- 1 file changed, 35 insertions(+), 35 deletions(-) (limited to 'packages/website/ts/redux/dispatcher.ts') diff --git a/packages/website/ts/redux/dispatcher.ts b/packages/website/ts/redux/dispatcher.ts index ad5553c58..0723fae30 100644 --- a/packages/website/ts/redux/dispatcher.ts +++ b/packages/website/ts/redux/dispatcher.ts @@ -15,53 +15,53 @@ import { } from 'ts/types'; export class Dispatcher { - private dispatch: Dispatch; + private _dispatch: Dispatch; constructor(dispatch: Dispatch) { - this.dispatch = dispatch; + this._dispatch = dispatch; } // Portal public resetState() { - this.dispatch({ + this._dispatch({ type: ActionTypes.ResetState, }); } public updateNodeVersion(nodeVersion: string) { - this.dispatch({ + this._dispatch({ data: nodeVersion, type: ActionTypes.UpdateNodeVersion, }); } public updateScreenWidth(screenWidth: ScreenWidths) { - this.dispatch({ + this._dispatch({ data: screenWidth, type: ActionTypes.UpdateScreenWidth, }); } public swapAssetTokenSymbols() { - this.dispatch({ + this._dispatch({ type: ActionTypes.SwapAssetTokens, }); } public updateOrderSalt(salt: BigNumber) { - this.dispatch({ + this._dispatch({ data: salt, type: ActionTypes.UpdateOrderSalt, }); } public updateUserSuppliedOrderCache(order: Order) { - this.dispatch({ + this._dispatch({ data: order, type: ActionTypes.UpdateUserSuppliedOrderCache, }); } public updateShouldBlockchainErrDialogBeOpen(shouldBeOpen: boolean) { - this.dispatch({ + this._dispatch({ data: shouldBeOpen, type: ActionTypes.UpdateShouldBlockchainErrDialogBeOpen, }); } public updateChosenAssetToken(side: Side, token: AssetToken) { - this.dispatch({ + this._dispatch({ data: { side, token, @@ -70,7 +70,7 @@ export class Dispatcher { }); } public updateChosenAssetTokenAddress(side: Side, address: string) { - this.dispatch({ + this._dispatch({ data: { address, side, @@ -79,72 +79,72 @@ export class Dispatcher { }); } public updateOrderTakerAddress(address: string) { - this.dispatch({ + this._dispatch({ data: address, type: ActionTypes.UpdateOrderTakerAddress, }); } public updateUserAddress(address: string) { - this.dispatch({ + this._dispatch({ data: address, type: ActionTypes.UpdateUserAddress, }); } public updateOrderExpiry(unixTimestampSec: BigNumber) { - this.dispatch({ + this._dispatch({ data: unixTimestampSec, type: ActionTypes.UpdateOrderExpiry, }); } public encounteredBlockchainError(err: BlockchainErrs) { - this.dispatch({ + this._dispatch({ data: err, type: ActionTypes.BlockchainErrEncountered, }); } public updateBlockchainIsLoaded(isLoaded: boolean) { - this.dispatch({ + this._dispatch({ data: isLoaded, type: ActionTypes.UpdateBlockchainIsLoaded, }); } public addTokenToTokenByAddress(token: Token) { - this.dispatch({ + this._dispatch({ data: token, type: ActionTypes.AddTokenToTokenByAddress, }); } public removeTokenToTokenByAddress(token: Token) { - this.dispatch({ + this._dispatch({ data: token, type: ActionTypes.RemoveTokenFromTokenByAddress, }); } public clearTokenByAddress() { - this.dispatch({ + this._dispatch({ type: ActionTypes.ClearTokenByAddress, }); } public updateTokenByAddress(tokens: Token[]) { - this.dispatch({ + this._dispatch({ data: tokens, type: ActionTypes.UpdateTokenByAddress, }); } public updateTokenStateByAddress(tokenStateByAddress: TokenStateByAddress) { - this.dispatch({ + this._dispatch({ data: tokenStateByAddress, type: ActionTypes.UpdateTokenStateByAddress, }); } public removeFromTokenStateByAddress(tokenAddress: string) { - this.dispatch({ + this._dispatch({ data: tokenAddress, type: ActionTypes.RemoveFromTokenStateByAddress, }); } public replaceTokenAllowanceByAddress(address: string, allowance: BigNumber) { - this.dispatch({ + this._dispatch({ data: { address, allowance, @@ -153,7 +153,7 @@ export class Dispatcher { }); } public replaceTokenBalanceByAddress(address: string, balance: BigNumber) { - this.dispatch({ + this._dispatch({ data: { address, balance, @@ -162,7 +162,7 @@ export class Dispatcher { }); } public updateTokenBalanceByAddress(address: string, balanceDelta: BigNumber) { - this.dispatch({ + this._dispatch({ data: { address, balanceDelta, @@ -171,25 +171,25 @@ export class Dispatcher { }); } public updateSignatureData(signatureData: SignatureData) { - this.dispatch({ + this._dispatch({ data: signatureData, type: ActionTypes.UpdateOrderSignatureData, }); } public updateUserEtherBalance(balance: BigNumber) { - this.dispatch({ + this._dispatch({ data: balance, type: ActionTypes.UpdateUserEtherBalance, }); } public updateNetworkId(networkId: number) { - this.dispatch({ + this._dispatch({ data: networkId, type: ActionTypes.UpdateNetworkId, }); } public updateOrderFillAmount(amount: BigNumber) { - this.dispatch({ + this._dispatch({ data: amount, type: ActionTypes.UpdateOrderFillAmount, }); @@ -197,13 +197,13 @@ export class Dispatcher { // Docs public updateCurrentDocsVersion(version: string) { - this.dispatch({ + this._dispatch({ data: version, type: ActionTypes.UpdateLibraryVersion, }); } public updateAvailableDocVersions(versions: string[]) { - this.dispatch({ + this._dispatch({ data: versions, type: ActionTypes.UpdateAvailableLibraryVersions, }); @@ -211,24 +211,24 @@ export class Dispatcher { // Shared public showFlashMessage(msg: string|React.ReactNode) { - this.dispatch({ + this._dispatch({ data: msg, type: ActionTypes.ShowFlashMessage, }); } public hideFlashMessage() { - this.dispatch({ + this._dispatch({ type: ActionTypes.HideFlashMessage, }); } public updateProviderType(providerType: ProviderType) { - this.dispatch({ + this._dispatch({ type: ActionTypes.UpdateProviderType, data: providerType, }); } public updateInjectedProviderName(injectedProviderName: string) { - this.dispatch({ + this._dispatch({ type: ActionTypes.UpdateInjectedProviderName, data: injectedProviderName, }); -- cgit v1.2.3 From e744e4cd989bd3ae1070c59f7baa8097f18b8b06 Mon Sep 17 00:00:00 2001 From: Leonid Logvinov Date: Fri, 22 Dec 2017 15:05:32 +0100 Subject: Apply prettier config --- packages/website/ts/redux/dispatcher.ts | 66 ++++++++++++++++----------------- 1 file changed, 33 insertions(+), 33 deletions(-) (limited to 'packages/website/ts/redux/dispatcher.ts') diff --git a/packages/website/ts/redux/dispatcher.ts b/packages/website/ts/redux/dispatcher.ts index 0723fae30..184ef0a05 100644 --- a/packages/website/ts/redux/dispatcher.ts +++ b/packages/website/ts/redux/dispatcher.ts @@ -1,6 +1,6 @@ import BigNumber from 'bignumber.js'; -import {Dispatch} from 'redux'; -import {State} from 'ts/redux/reducer'; +import { Dispatch } from 'redux'; +import { State } from 'ts/redux/reducer'; import { ActionTypes, AssetToken, @@ -98,44 +98,44 @@ export class Dispatcher { } public encounteredBlockchainError(err: BlockchainErrs) { this._dispatch({ - data: err, - type: ActionTypes.BlockchainErrEncountered, - }); + data: err, + type: ActionTypes.BlockchainErrEncountered, + }); } public updateBlockchainIsLoaded(isLoaded: boolean) { this._dispatch({ - data: isLoaded, - type: ActionTypes.UpdateBlockchainIsLoaded, - }); + data: isLoaded, + type: ActionTypes.UpdateBlockchainIsLoaded, + }); } public addTokenToTokenByAddress(token: Token) { this._dispatch({ - data: token, - type: ActionTypes.AddTokenToTokenByAddress, - }); + data: token, + type: ActionTypes.AddTokenToTokenByAddress, + }); } public removeTokenToTokenByAddress(token: Token) { this._dispatch({ - data: token, - type: ActionTypes.RemoveTokenFromTokenByAddress, - }); + data: token, + type: ActionTypes.RemoveTokenFromTokenByAddress, + }); } public clearTokenByAddress() { this._dispatch({ type: ActionTypes.ClearTokenByAddress, - }); + }); } public updateTokenByAddress(tokens: Token[]) { this._dispatch({ - data: tokens, - type: ActionTypes.UpdateTokenByAddress, - }); + data: tokens, + type: ActionTypes.UpdateTokenByAddress, + }); } public updateTokenStateByAddress(tokenStateByAddress: TokenStateByAddress) { this._dispatch({ - data: tokenStateByAddress, - type: ActionTypes.UpdateTokenStateByAddress, - }); + data: tokenStateByAddress, + type: ActionTypes.UpdateTokenStateByAddress, + }); } public removeFromTokenStateByAddress(tokenAddress: string) { this._dispatch({ @@ -146,8 +146,8 @@ export class Dispatcher { public replaceTokenAllowanceByAddress(address: string, allowance: BigNumber) { this._dispatch({ data: { - address, - allowance, + address, + allowance, }, type: ActionTypes.ReplaceTokenAllowanceByAddress, }); @@ -172,21 +172,21 @@ export class Dispatcher { } public updateSignatureData(signatureData: SignatureData) { this._dispatch({ - data: signatureData, - type: ActionTypes.UpdateOrderSignatureData, - }); + data: signatureData, + type: ActionTypes.UpdateOrderSignatureData, + }); } public updateUserEtherBalance(balance: BigNumber) { this._dispatch({ - data: balance, - type: ActionTypes.UpdateUserEtherBalance, - }); + data: balance, + type: ActionTypes.UpdateUserEtherBalance, + }); } public updateNetworkId(networkId: number) { this._dispatch({ - data: networkId, - type: ActionTypes.UpdateNetworkId, - }); + data: networkId, + type: ActionTypes.UpdateNetworkId, + }); } public updateOrderFillAmount(amount: BigNumber) { this._dispatch({ @@ -210,7 +210,7 @@ export class Dispatcher { } // Shared - public showFlashMessage(msg: string|React.ReactNode) { + public showFlashMessage(msg: string | React.ReactNode) { this._dispatch({ data: msg, type: ActionTypes.ShowFlashMessage, -- cgit v1.2.3 From 4dfa720f2dec2be0b0758633c087579a02e482bb Mon Sep 17 00:00:00 2001 From: Leonid Logvinov Date: Thu, 4 Jan 2018 12:38:19 +0100 Subject: Use configured version of bignumber in all packages --- packages/website/ts/redux/dispatcher.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'packages/website/ts/redux/dispatcher.ts') diff --git a/packages/website/ts/redux/dispatcher.ts b/packages/website/ts/redux/dispatcher.ts index 184ef0a05..42989e5e1 100644 --- a/packages/website/ts/redux/dispatcher.ts +++ b/packages/website/ts/redux/dispatcher.ts @@ -1,4 +1,4 @@ -import BigNumber from 'bignumber.js'; +import { BigNumber } from '@0xproject/utils'; import { Dispatch } from 'redux'; import { State } from 'ts/redux/reducer'; import { -- cgit v1.2.3