Function skipSomePropertyUndefined

  • Skips / filters values which contains undefined for any property. Narrows the type of all properties within the object type from T | undefined to just T.

    marble

    Example:

    const x: Observable<{ a: number | undefined, b: string | undefined }>;

    const z: Observable<{ a: number, b: string }> = x.pipe(
    skipSomePropertyUndefined
    );

    value { a: 1, b: 'foo' } will pass through

    value { a: 1, b: undefined } will be skipped

    value { a: undefined, b: 'foo' } will be skipped

    Type Parameters

    • T extends object

    Returns ((source) => Observable<{
        [P in string | number | symbol]: NonUndefined<T[P]>
    }>)

      • (source): Observable<{
            [P in string | number | symbol]: NonUndefined<T[P]>
        }>
      • Parameters

        • source: Observable<T>

        Returns Observable<{
            [P in string | number | symbol]: NonUndefined<T[P]>
        }>

Generated using TypeDoc