vuex-class typed getters with parameters

[vuex-class](' documentation doesn't come with clear steps on how one could call a getter with one or more arguments. 

Here's how you do it: 

  protected workspace: WorkspaceType | null = null;
  public byId!: (id: WorkspaceId) => WorkspaceType;
  mounted(): void {
    this.workspace = this.byId({ id: this.activeWorkspaceId });

Nick Ciolpan
18 Mar 2021
« Back to post