cnap-cobre/synapse

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

Summary

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