UNPKG

qwc2

Version:
43 lines (42 loc) 1.16 kB
/** * Copyright 2024 Sourcepole AG * All rights reserved. * * This source code is licensed under the BSD-style license found in the * LICENSE file in the root directory of this source tree. */ import ReducerIndex from '../reducers/index'; import processNotificationsReducer from '../reducers/processNotifications'; ReducerIndex.register("processNotifications", processNotificationsReducer); export var PROCESS_STARTED = 'PROCESS_STARTED'; export var PROCESS_FINISHED = 'PROCESS_FINISHED'; export var CLEAR_PROCESS = 'CLEAR_PROCESS'; export var ProcessStatus = { BUSY: 1, SUCCESS: 2, FAILURE: 3 }; export function processStarted(id, name) { return { type: PROCESS_STARTED, id: id, name: name }; } export function processFinished(id, success) { var message = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : ""; var timeout = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : true; return { type: PROCESS_FINISHED, id: id, success: success, message: message, timeout: timeout }; } export function clearProcess(id) { return { type: CLEAR_PROCESS, id: id }; }