flyd icon indicating copy to clipboard operation
flyd copied to clipboard

Support multiple operators for Pipe

Open NoelAbrahams opened this issue 1 year ago • 4 comments

Hi — brilliant library

Simple question: I would like to do the following:

mystream
    .pipe(
       flyd.filter(value => value !== 'foo'),
       flyd.skip(1),
       flyd.dropRepeats()
    )
    .map((value) => {
        console.log(value);
    });

Instead of

mystream
    .pipe(flyd.filter(value => value !== 'foo'))
    .pipe(flyd.skip(1))
    .pipe(flyd.dropRepeats())
    .map((value) => {
        console.log(value);
    });

Basically to avoid repeating .pipe as it is much cleaner.

I've seen some discussion here: https://github.com/paldepind/flyd/issues/137

I'm assuming this pattern for pipe is somehow contrary to the design of flyd?

Thanks

NoelAbrahams avatar Jan 28 '24 12:01 NoelAbrahams