UNPKG

@alilc/lowcode-editor-core

Version:

Core Api for Ali lowCode engine

23 lines 531 B
var globalEventOn = true; export function setGlobalEventFlag(flag) { globalEventOn = flag; } export function switchGlobalEventOn() { setGlobalEventFlag(true); } export function switchGlobalEventOff() { setGlobalEventFlag(false); } export function isGlobalEventOn() { return globalEventOn; } export function runWithGlobalEventOff(fn) { switchGlobalEventOff(); fn(); switchGlobalEventOn(); } export function wrapWithEventSwitch(fn) { return function () { if (isGlobalEventOn()) fn.apply(void 0, arguments); }; }