New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a es.chain? #89

Closed
XeCycle opened this Issue Sep 21, 2015 · 2 comments

Comments

Projects
None yet
2 participants
@XeCycle
Contributor

XeCycle commented Sep 21, 2015

Currently I have something like this (es6):

function chain(...streams) {
  var [head] = streams;
  var tail = streams.reduce((prev, curr) => prev.pipe(curr));
  return es.duplex(head, tail);
}

so that I can write

function formatter() {
  return chain(
    es.split(),
    es.mapSync(...),
    es.stringify()
  );
}

someStream.pipe(formatter());

Would you like this added to event-stream? If yes please also tell me what behaviour you want, e.g. multiple arguments or single array argument, and what to do with empty array, maybe also other corner cases. I can go PR.

@dominictarr

This comment has been minimized.

Owner

dominictarr commented Sep 22, 2015

you should use https://github.com/dominictarr/stream-combiner for that. it also sets up error listeners on the intermediate streams, etc. I'm not adding any new features to event-stream.

@XeCycle

This comment has been minimized.

Contributor

XeCycle commented Sep 22, 2015

I see, sorry I did not take a look at your other repos.

@XeCycle XeCycle closed this Sep 22, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment