starter.dev-github-showcases icon indicating copy to clipboard operation
starter.dev-github-showcases copied to clipboard

[Angular-Apollo-Tailwind] Fix inconsistencies in component's store use

Open Atrophius opened this issue 3 years ago • 0 comments

  • Pull requests use single store that also manages filters, however issues have 2 separate stores.
  • Component's state seems to be designed in a way that doesn't support easy reactivity eg.
export class IssuesComponent implements OnInit {
    setLabel(label: string) {
      this.reposFilterStore.setLabel(label);
      this.issuesStore.getIssues$(this.filterState$);
    }
  }
  • Repos component on the other hand doesn't use the component's store at all.

Acceptances

Pull requests use single store that also manages filters, however issues have 2 separate stores.

  • The approach should be unified.

Component's state seems to be designed in a way that doesn't support easy reactivity.

  • Currently, every time we change anything in the filter state we need to manually call this.issuesStore.getIssues$(this.filterState$). This behaviors should be a responsibility of the store to manage that IMO. Similar thing happens in pull requests logic

Repos component on the other hand doesn't use the component's store at all.

  • I think it would be good to extract the state logic into repo's own component state to be consistent (and also hide GraphQL implementation details)

Atrophius avatar Sep 12 '22 15:09 Atrophius