improve boolFactory return type
This commit is contained in:
parent
62e828db37
commit
786c43c150
@ -29,7 +29,10 @@ export function shareDistinctLast<T>(values = 1): UnaryFunction<Observable<T>, O
|
||||
export const toLengthValue = (entities: unknown[]): number => entities?.length ?? 0;
|
||||
export const getLength = pipe(map(toLengthValue), distinctUntilChanged());
|
||||
|
||||
export function boolFactory<T = boolean>(obs: Observable<T>, project: (value: T) => boolean = value => !!value): Observable<boolean>[] {
|
||||
export function boolFactory<T = boolean>(
|
||||
obs: Observable<T>,
|
||||
project: (value: T) => boolean = value => !!value,
|
||||
): readonly [Observable<boolean>, Observable<boolean>] {
|
||||
const result = obs.pipe(map(project), shareDistinctLast());
|
||||
|
||||
const inverse = result.pipe(
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user