UNPKG

devextreme

Version:

HTML5 JavaScript Component Suite for Responsive Web Development

27 lines (26 loc) 754 B
/** * DevExtreme (esm/__internal/core/r1/runtime/inferno/effect_host.js) * Version: 25.1.3 * Build date: Wed Jun 25 2025 * * Copyright (c) 2012 - 2025 Developer Express Inc. ALL RIGHTS RESERVED * Read about DevExtreme licensing here: https://js.devexpress.com/Licensing/ */ export const InfernoEffectHost = { lockCount: 0, lock() { this.lockCount++ }, callbacks: [], callEffects() { this.lockCount--; if (this.lockCount < 0) { throw new Error("Unexpected Effect Call") } if (0 === this.lockCount) { const effects = this.callbacks; this.callbacks = []; effects.forEach((callback => callback())) } } };