@ckeditor/ckeditor5-ui
Version:
The UI framework and standard UI library of CKEditor 5.
32 lines (31 loc) • 1.01 kB
JavaScript
/**
* @license Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved.
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
*/
/**
* @module ui/model
*/
import { ObservableMixin } from '@ckeditor/ckeditor5-utils';
import { extend } from 'es-toolkit/compat';
/**
* The base MVC model class.
*/
export default class Model extends /* #__PURE__ */ ObservableMixin() {
/**
* Creates a new Model instance.
*
* @param attributes The model state attributes to be defined during the instance creation.
* @param properties The (out of state) properties to be appended to the instance during creation.
*/
constructor(attributes, properties) {
super();
// Extend this instance with the additional (out of state) properties.
if (properties) {
extend(this, properties);
}
// Initialize the attributes.
if (attributes) {
this.set(attributes);
}
}
}