UNPKG

lml-main

Version:

This is now a mono repository published into many standalone packages.

19 lines 1.5 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); const redux_observable_1 = require("redux-observable"); const cosmo_redux_api_1 = require("@lml/cosmo-redux-api"); const cosmoui_1 = require("cosmoui"); const postSuccess = (action$, store) => action$.ofType(cosmo_redux_api_1.POST_JOB_LABEL.SUCCESS) .map(action => cosmoui_1.notificationSuccess('Job label successfully created')); const putSuccess = (action$, store) => action$.ofType(cosmo_redux_api_1.PUT_JOB_LABEL.SUCCESS) .map(action => cosmoui_1.notificationSuccess('Job label successfully updated')); const deleteSuccess = (action$, store) => action$.ofType(cosmo_redux_api_1.DELETE_JOB_LABEL.SUCCESS) .map(action => cosmoui_1.notificationSuccess('Job label successfully deleted')); const postFailure = (action$, store) => action$.ofType(cosmo_redux_api_1.POST_JOB_LABEL.ERROR) .map(action => cosmoui_1.notificationError('Failed to create job label')); const putFailure = (action$, store) => action$.ofType(cosmo_redux_api_1.PUT_JOB_LABEL.ERROR) .map(action => cosmoui_1.notificationError('Failed to update job label')); const deleteFailure = (action$, store) => action$.ofType(cosmo_redux_api_1.DELETE_JOB_LABEL.ERROR) .map(action => cosmoui_1.notificationError('Failed to delete job label')); exports.jobLabelNotifications = redux_observable_1.combineEpics(postSuccess, putSuccess, deleteSuccess, postFailure, putFailure, deleteFailure); //# sourceMappingURL=job-label-notifications.js.map