cnap-cobre/synapse

View on GitHub
frontend/src/store/userProfile/sagas.js

Summary

Maintainability
A
40 mins
Test Coverage
import {
all, call, put, takeLatest,
} from 'redux-saga/effects';
import * as Synapse from '../../services/Synapse';
import * as types from './types';
import { actions } from './UserProfile';
 
 
Similar blocks of code found in 2 locations. Consider refactoring.
function* getUserProfile() {
try {
const userProfile = yield call(Synapse.fetchUserProfile);
yield put(actions.success(userProfile));
} catch (e) {
console.log(e);
yield put(actions.error(e));
}
}
 
export default function* () {
yield all([
takeLatest(types.GET_USER_PROFILE_ASYNC.PENDING, getUserProfile),
]);
}