UNPKG

@stackend/api

Version:

JS bindings to api.stackend.com

38 lines 1.28 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.setLoadingThrobberVisible = exports.setModalThrobberVisible = void 0; var throbberReducer_1 = require("./throbberReducer"); /** * Show/hide the modal throbber * @param visible */ function setModalThrobberVisible(visible) { return function (dispatch) { return dispatch({ type: visible ? throbberReducer_1.XCAP_MODAL_THROBBER_INCREASE : throbberReducer_1.XCAP_MODAL_THROBBER_DECREASE }); }; } exports.setModalThrobberVisible = setModalThrobberVisible; /** * Show/hide the unobtrusive loading throbber * @param visible * @returns {Function} */ function setLoadingThrobberVisible(visible) { return function (dispatch, getState) { dispatch({ type: visible ? throbberReducer_1.XCAP_LOADING_THROBBER_INCREASE : throbberReducer_1.XCAP_LOADING_THROBBER_DECREASE }); if (!visible) { var throbber = getState().throbber; if (!throbber.loading) { dispatch({ type: throbberReducer_1.XCAP_LOADING_COMPLETE }); } } }; } exports.setLoadingThrobberVisible = setLoadingThrobberVisible; //# sourceMappingURL=throbberActions.js.map