-
Notifications
You must be signed in to change notification settings - Fork 504
/
sagas.ts
32 lines (28 loc) · 821 Bytes
/
sagas.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
import { actions } from 'data'
import { put } from 'redux-saga/effects'
import * as A from './actions'
export const logLocation = 'components/fiatTransactions/sagas'
export default () => {
const initialized = function * (action: ReturnType<typeof A.initialized>) {
try {
yield put(
actions.core.data.fiat.fetchTransactions(action.payload.currency, true)
)
} catch (e) {
yield put(actions.logs.logErrorMessage(logLocation, 'initialized', e))
}
}
const loadMore = function * (action: ReturnType<typeof A.loadMore>) {
try {
yield put(
actions.core.data.fiat.fetchTransactions(action.payload.currency)
)
} catch (e) {
yield put(actions.logs.logErrorMessage(logLocation, 'loadMore', e))
}
}
return {
initialized,
loadMore
}
}