import { call, put, takeEvery } from 'typed-redux-saga';
import { getLoded } from '../../utils';
import { lodeActions } from './slice';

function* initSaga(action) {
  var {
    initLodesSuccessAction,
    initLodesFailureAction
  } = lodeActions;

  try {
    var lode = yield* call(getLoded, action.payload.examplesLodeUrl, action.payload.declarationsLodeUrl);
    yield* put(initLodesSuccessAction(lode));
  } catch (error) {
    yield* put(initLodesFailureAction(error));
  }
}

export function* saga() {
  var {
    initLodesAction
  } = lodeActions;
  yield* takeEvery(initLodesAction, initSaga);
}
//# sourceMappingURL=sagas.js.map