chore: simplify typings

This commit is contained in:
Jacob Overgaard
2024-07-08 17:28:04 +02:00
parent d0c7ff23e9
commit 1411bb960f

View File

@@ -8,11 +8,11 @@ import type { UmbApi } from '@umbraco-cms/backoffice/extension-api';
* The base class for a store that holds an object.
*/
export class UmbStoreObjectBase<T> extends UmbContextBase<never> implements UmbApi {
protected _data: UmbObjectState<T | undefined>;
protected _data;
constructor(host: UmbControllerHost, storeAlias: string, initialData?: T) {
super(host, storeAlias);
this._data = new UmbObjectState(initialData);
this._data = new UmbObjectState<T | null>(initialData ?? null);
}
/**
@@ -29,7 +29,7 @@ export class UmbStoreObjectBase<T> extends UmbContextBase<never> implements UmbA
* Returns the current state of the store
* @memberof UmbStoreObjectBase
*/
getState(): T | undefined {
getState() {
return this._data.getValue();
}