diff --git a/client/src/view.js b/client/src/view.js index 20da8d3d16..8e94cabc68 100644 --- a/client/src/view.js +++ b/client/src/view.js @@ -44,24 +44,6 @@ class View extends BullView { * @param {HTMLElement} element A target element. */ - /** - * A model. - * - * @name model - * @type {module:model|null} - * @memberOf View.prototype - * @public - */ - - /** - * A collection. - * - * @name collection - * @type {module:collection|null} - * @memberOf View.prototype - * @public - */ - /** * A helper. * @@ -71,6 +53,36 @@ class View extends BullView { * @private */ + /** + * A model. + * + * @type {import('model').default} + */ + model + + /** + * A collection. + * + * @type {import('collection').default} + */ + collection + + /** + * @param {Record} options + */ + constructor(options = {}) { + super(options); + + if (options.model) { + this.model = options.model; + } + + if (options.collection) { + this.collection = options.collection; + } + } + + // noinspection JSUnusedGlobalSymbols /** * When the view is ready. Can be useful to prevent race condition when re-initialization is needed