Hey, is it okey to have multiple effect() in constructor for example like this?
effect(() => {
if (this.authState.getUserStatus() === 'error')
this.authService.signOut();
});
effect(
() => {
if (!this.authState.isSignedIn()) return;
AddedCompanyNotifier.listen();
this.companyContextState.getCompanies();
},
{ allowSignalWrites: true }
);
effect(
() => {
if (!this.authState.isSignedIn()) return;
if (this.companyContextState.companies().status === 'success') {
this.localStorageCompanyContextService.getItem().subscribe((q) => {
const companyId =
q ??
this.companyContextState.companies().entities[0]?.id ??
Guid.createEmpty();
this.companyContextState.setCompanyContextId(companyId);
});
}
},
{ allowSignalWrites: true }
);