-
-
Notifications
You must be signed in to change notification settings - Fork 130
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
WARNING in Circular dependency detected: #2
Comments
@sunger thanks for informing. for now you can ignore this warning. I will see how I can avoid such circular dependency. I may have to reference this.store.select(AuthState.authMode).subscribe(authMode => {
console.log(`Auth Mode Changed: ${this.authMode} => ${authMode}`);
this.authMode = authMode;
}); may be like this: this.store.select('auth.authMode').subscribe(authMode => {
console.log(`Auth Mode Changed: ${this.authMode} => ${authMode}`);
this.authMode = authMode;
}); |
You can try: |
@eranshmil as long as you use/refer @Select('auth.authMode') authMode$: Observable<AuthMode>;
and
this.authMode$.subscribe(authMode => {
console.log(`Auth Mode Changed: ${this.authMode} => ${authMode}`);
this.authMode = authMode;
}); with this approach, I see ngxs store fires change event twice. which I don't like :( Console log:
With static reference to AuthState ie.
|
I'd guess that's because the auth service is being initialized before auth state.
I don't see any reason for that to be in the service and not in an action. |
fixed. |
WARNING in Circular dependency detected:
libs\auth\src\auth.service.ts -> libs\auth\src\auth.state.ts -> libs\auth\src\auth.service.ts
WARNING in Circular dependency detected:
libs\auth\src\auth.state.ts -> libs\auth\src\auth.service.ts -> libs\auth\src\auth.state.ts
The text was updated successfully, but these errors were encountered: