-
Notifications
You must be signed in to change notification settings - Fork 504
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(redux): convert modules/transferEth to slice (#6296)
- Loading branch information
1 parent
0608eb8
commit 7fc497d
Showing
10 changed files
with
48 additions
and
93 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 0 additions & 6 deletions
6
packages/blockchain-wallet-v4-frontend/src/data/modules/transferEth/actionTypes.ts
This file was deleted.
Oops, something went wrong.
26 changes: 0 additions & 26 deletions
26
packages/blockchain-wallet-v4-frontend/src/data/modules/transferEth/actions.ts
This file was deleted.
Oops, something went wrong.
37 changes: 0 additions & 37 deletions
37
packages/blockchain-wallet-v4-frontend/src/data/modules/transferEth/reducers.ts
This file was deleted.
Oops, something went wrong.
6 changes: 3 additions & 3 deletions
6
packages/blockchain-wallet-v4-frontend/src/data/modules/transferEth/sagaRegister.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,13 @@ | ||
import { takeLatest } from 'redux-saga/effects' | ||
|
||
import * as AT from './actionTypes' | ||
import sagas from './sagas' | ||
import { actions } from './transferEthSlice' | ||
|
||
export default ({ coreSagas, networks }) => { | ||
const transferEthSagas = sagas({ coreSagas, networks }) | ||
|
||
return function* transferEthSaga() { | ||
yield takeLatest(AT.CONFIRM_TRANSFER_ETH, transferEthSagas.confirmTransferEth) | ||
yield takeLatest(AT.TRANSFER_ETH_INITIALIZED, transferEthSagas.initialized) | ||
yield takeLatest(actions.confirmTransferEth, transferEthSagas.confirmTransferEth) | ||
yield takeLatest(actions.transferEthInitialized, transferEthSagas.initialized) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
35 changes: 35 additions & 0 deletions
35
packages/blockchain-wallet-v4-frontend/src/data/modules/transferEth/transferEthSlice.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
import { createSlice, PayloadAction } from '@reduxjs/toolkit' | ||
|
||
import { Remote } from '@core' | ||
|
||
import { TransferEthState } from './types' | ||
|
||
const initialState: TransferEthState = { | ||
payment: Remote.NotAsked | ||
} | ||
|
||
const trasnferEthSlice = createSlice({ | ||
initialState, | ||
name: 'transferEth', | ||
reducers: { | ||
confirmTransferEth: ( | ||
state, | ||
action: PayloadAction<{ effectiveBalance: string | number; to: string | number }> | ||
) => {}, | ||
transferEthInitialized: (state, action: PayloadAction<{ from: string; type: 'LEGACY' }>) => { | ||
state.payment = Remote.NotAsked | ||
}, | ||
transferEthPaymentUpdatedFailure: (state, action) => { | ||
state.payment = Remote.Failure(action.payload) | ||
}, | ||
transferEthPaymentUpdatedLoading: (state) => { | ||
state.payment = Remote.Loading | ||
}, | ||
transferEthPaymentUpdatedSuccess: (state, action) => { | ||
state.payment = Remote.Success(action.payload) | ||
} | ||
} | ||
}) | ||
|
||
export const { actions } = trasnferEthSlice | ||
export const transferEthReducer = trasnferEthSlice.reducer |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters