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

    Function skipPropertyUndefined

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

      marble

      Example:

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

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

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

      value { a: 1, b: undefined } 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 ? NonUndefined<T[X]> : T[X]
          },
      >