starter.dev-github-showcases
starter.dev-github-showcases copied to clipboard
[Angular-Apollo-Tailwind] Fix inconsistencies in component's store use
- 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)