@onereach/webform
Version:
Content Builder includes several views for: - Content builder view itself; - Web Form view; - Slack block-kit builder;
27 lines (21 loc) • 867 B
JavaScript
import Vue from 'vue';
export default class UIEventBus {
static _instance = new Vue();
static $emit (event, ...args) {
console.debug('[RWC::UIEventBus] ', event, args, new Date().toLocaleString());
this._instance.$emit(event, ...args);
}
static $on (event, callback) {
this._instance.$on(event, callback);
}
static $off (event, callback) {
this._instance.$off(event, callback);
}
}
export const THROW_API_ERROR = 'THROW_API_ERROR';
export const THROW_WEBSOCKET_CONNECTION_ERROR = 'THROW_WEBSOCKET_CONNECTION_ERROR';
export const SHOW_NOTIFICATION = 'SHOW_NOTIFICATION';
export const WEBSOCKET_RECONNECT_EVENT = 'WEBSOCKET_RECONNECT_EVENT';
export const WEBSOCKET_CLOSE_EVENT = 'WEBSOCKET_CLOSE_EVENT';
export const WEBSOCKET_OFFLINE_EVENT = 'WEBSOCKET_OFFLINE_EVENT';
export const WEBSOCKET_ONLINE_EVENT = 'WEBSOCKET_ONLINE_EVENT';