UNPKG

@bemedev/rx-add-ons

Version:

A collection of RxJS operators and utilities to enhance reactive programming capabilities.

1 lines 836 B
{"version":3,"file":"skip.cjs","sources":["../src/skip.ts"],"sourcesContent":["import { tap } from 'rxjs/internal/operators/tap';\nimport { skipWhile as skip } from 'rxjs/internal/operators/skipWhile';\nimport { Identity, Predicate } from './types';\n\nexport function skipWhile<T>(predicate: Predicate<T>): Identity<T> {\n return source => {\n const all: T[] = [];\n return source.pipe(\n tap(v => all.push(v)),\n skip((value, index) => predicate(value, index, all)),\n );\n };\n}\n"],"names":["tap","skip"],"mappings":";;;;;AAIM,SAAU,SAAS,CAAI,SAAuB,EAAA;IAClD,OAAO,MAAM,IAAG;QACd,MAAM,GAAG,GAAQ,EAAE;AACnB,QAAA,OAAO,MAAM,CAAC,IAAI,CAChBA,OAAG,CAAC,CAAC,IAAI,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,EACrBC,qBAAI,CAAC,CAAC,KAAK,EAAE,KAAK,KAAK,SAAS,CAAC,KAAK,EAAE,KAAK,EAAE,GAAG,CAAC,CAAC,CACrD;AACH,IAAA,CAAC;AACH;;;;"}