specify types directly on UserWorkspace and EntityWorkspace

This commit is contained in:
Jacob Overgaard
2023-03-01 11:15:25 +01:00
parent 7e3ab09ba3
commit 7e5e10be66
2 changed files with 10 additions and 2 deletions

View File

@@ -10,7 +10,11 @@ export class UmbWorkspaceUserGroupContext
extends UmbWorkspaceContext<UmbUserGroupRepository>
implements UmbWorkspaceEntityContextInterface<UserGroupDetails | undefined>
{
#manager = new UmbEntityWorkspaceManager(this.host, 'user-group', UMB_USER_GROUP_STORE_CONTEXT_TOKEN);
#manager = new UmbEntityWorkspaceManager<typeof UMB_USER_GROUP_STORE_CONTEXT_TOKEN.TYPE>(
this.host,
'user-group',
UMB_USER_GROUP_STORE_CONTEXT_TOKEN
);
public readonly data = this.#manager.state.asObservable();
public readonly name = this.#manager.state.getObservablePart((state) => state?.name);

View File

@@ -10,7 +10,11 @@ export class UmbWorkspaceUserContext
extends UmbWorkspaceContext<UmbUserRepository>
implements UmbWorkspaceEntityContextInterface<UserDetails | undefined>
{
#manager = new UmbEntityWorkspaceManager(this.host, 'user', UMB_USER_STORE_CONTEXT_TOKEN);
#manager = new UmbEntityWorkspaceManager<typeof UMB_USER_STORE_CONTEXT_TOKEN.TYPE>(
this.host,
'user',
UMB_USER_STORE_CONTEXT_TOKEN
);
public readonly data = this.#manager.state.asObservable();
public readonly name = this.#manager.state.getObservablePart((state) => state?.name);