@looker/embed-components
Version:
30 lines (29 loc) • 790 B
JavaScript
;
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.saga = saga;
var _typedReduxSaga = require("typed-redux-saga");
var _embedServices = require("@looker/embed-services");
var _slice = require("./slice");
function* initSaga(action) {
var {
initFactorySuccessAction,
setFailureAction
} = _slice.factoryActions;
try {
(0, _embedServices.createFactory)(action.payload.sdk);
yield* (0, _typedReduxSaga.put)(initFactorySuccessAction());
} catch (error) {
yield* (0, _typedReduxSaga.put)(setFailureAction({
error: error.message
}));
}
}
function* saga() {
var {
initFactoryAction
} = _slice.factoryActions;
yield* (0, _typedReduxSaga.takeEvery)(initFactoryAction, initSaga);
}
//# sourceMappingURL=sagas.js.map