UNPKG

devextreme

Version:

HTML5 JavaScript Component Suite for Responsive Web Development

37 lines (36 loc) 1.04 kB
/** * DevExtreme (cjs/__internal/core/r1/runtime/inferno/effect.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/ */ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.InfernoEffect = void 0; class InfernoEffect { constructor(effect, dependency) { this.dependency = dependency; this.effect = effect; this.destroy = effect() } update(dependency) { const currentDependency = this.dependency; if (dependency) { this.dependency = dependency } if (!dependency || dependency.some(((d, i) => currentDependency[i] !== d))) { this.dispose(); this.destroy = this.effect() } } dispose() { if (this.destroy) { this.destroy() } } } exports.InfernoEffect = InfernoEffect;