- takeWhile<T, R>(condition: ((v: T, idx: number) => v is R)): Transformer<T, R>
Parameters
- condition: ((v: T, idx: number) => v is R)
- (v: T, idx: number): v is R
Returns v is R
- takeWhile<T>(condition: ((v: T, idx: number) => boolean)): Transformer<T>
Parameters
- condition: ((v: T, idx: number) => boolean)
- (v: T, idx: number): boolean
Returns boolean
Take items from a stream until a given condition is false, then close the output. The condition function is not called again after it returns false.
If the condition function is typed as a Typescript type guard (i.e. as returning.
v is SomeType
), then the resulting source will be typed as Source