devextreme
Version:
HTML5 JavaScript Component Suite for Responsive Web Development
33 lines (32 loc) • 978 B
JavaScript
/**
* DevExtreme (esm/__internal/integration/knockout/variable_wrapper_utils.js)
* Version: 25.2.3
* Build date: Fri Dec 12 2025
*
* Copyright (c) 2012 - 2025 Developer Express Inc. ALL RIGHTS RESERVED
* Read about DevExtreme licensing here: https://js.devexpress.com/Licensing/
*/
import {
variableWrapper
} from "../../core/utils/m_variable_wrapper";
import ko from "knockout";
if (ko) {
variableWrapper.inject({
isWrapped: ko.isObservable,
isWritableWrapped: ko.isWritableObservable,
wrap: ko.observable,
unwrap(value) {
if (ko.isObservable(value)) {
return ko.utils.unwrapObservable(value)
}
return this.callBase(value)
},
assign(variable, value) {
if (ko.isObservable(variable)) {
variable(value)
} else {
this.callBase(variable, value)
}
}
})
}