@w11k/rx-ninja
    Preparing search index...

    Function skipPropertyNull

    • Skips / filters values which contains null for the given property. Narrows the type of the given property within the object type from T | null to just T.

      Example:

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

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

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

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

      Type Parameters

      • T
      • P extends string | number | symbol

      Parameters

      • prop: P

        name of the property to check

      Returns (
          source: Observable<T>,
      ) => Observable<
          { [X in string
          | number
          | symbol]: X extends P ? NonNull<T[X]> : T[X] },
      >