mirror of
https://github.com/Raghu-Ch/angular-challenges.git
synced 2026-02-13 22:33:03 -05:00
fix: run prettier on all file to avoid prettier issue inside PR
This commit is contained in:
@@ -29,7 +29,7 @@ export class CallStateComponentStore<
|
||||
| (U & CallStateComponentState)
|
||||
| CallStateComponentState = U extends void
|
||||
? CallStateComponentState
|
||||
: U & CallStateComponentState
|
||||
: U & CallStateComponentState,
|
||||
> extends ComponentStore<T> {
|
||||
private error = inject(ERROR_TOKEN);
|
||||
private flickerTime = inject(FLICKER_TIME);
|
||||
@@ -39,23 +39,23 @@ export class CallStateComponentStore<
|
||||
}
|
||||
|
||||
readonly isLoading$: Observable<boolean> = this.select(
|
||||
(state) => state.callState === 'LOADING'
|
||||
(state) => state.callState === 'LOADING',
|
||||
);
|
||||
|
||||
readonly isLoadingWithFlicker$: Observable<boolean> = this.select(
|
||||
(state) => state.callState === 'LOADING'
|
||||
(state) => state.callState === 'LOADING',
|
||||
).pipe(
|
||||
switchMap((loading) => nonFlickerLoader(of(loading), this.flickerTime))
|
||||
switchMap((loading) => nonFlickerLoader(of(loading), this.flickerTime)),
|
||||
);
|
||||
|
||||
readonly isLoaded$: Observable<boolean> = this.select(
|
||||
(state) => state.callState === 'LOADED'
|
||||
(state) => state.callState === 'LOADED',
|
||||
).pipe(switchMap((loaded) => of(loaded)));
|
||||
|
||||
readonly callState$ = this.select((state) => state.callState);
|
||||
|
||||
readonly error$: Observable<string | undefined> = this.select((state) =>
|
||||
this.error.getErrorMessage(getErrorCallState(state.callState))
|
||||
this.error.getErrorMessage(getErrorCallState(state.callState)),
|
||||
);
|
||||
|
||||
readonly updateCallState = this.updater(
|
||||
@@ -64,7 +64,7 @@ export class CallStateComponentStore<
|
||||
...(state as object),
|
||||
callState: callState ?? 'LOADED',
|
||||
} as T;
|
||||
}
|
||||
},
|
||||
);
|
||||
|
||||
readonly startLoading = this.updater(
|
||||
@@ -74,7 +74,7 @@ export class CallStateComponentStore<
|
||||
...patchedState,
|
||||
callState: 'LOADING',
|
||||
} as T;
|
||||
}
|
||||
},
|
||||
);
|
||||
|
||||
readonly stopLoading = this.updater(
|
||||
@@ -84,12 +84,12 @@ export class CallStateComponentStore<
|
||||
...patchedState,
|
||||
callState: 'LOADED',
|
||||
} as T;
|
||||
}
|
||||
},
|
||||
);
|
||||
|
||||
protected handleError(
|
||||
error: unknown,
|
||||
patchedState: Partial<U> = {}
|
||||
patchedState: Partial<U> = {},
|
||||
): CallStateError {
|
||||
const err = this.error.toError(error);
|
||||
this.patchState({
|
||||
|
||||
Reference in New Issue
Block a user