-
Notifications
You must be signed in to change notification settings - Fork 84
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
Passing stream to another stream? #140
Comments
Hello @dmitriz. I think the way you do this with I agree that emitting the string representation of the function is unfortunate. But, while I think think the behavior you're suggesting is interesting, I must admit that I find it a bit too implicit. To me What do you think? |
Many thanks @paldepind for taking your time to comment!
That is exactly my intuition and was the very reason for this proposal After
May I ask why? Can it be misunderstood?
Glad we agree on that ;)
To me Also that would duplicate the already provided functionality of I would find it good to have both syntaxes I find unifying concepts under common abstraction a great way of reducing code complexity, and your idea of putting streams under the same hat with functions really neatly serving that purpose. It is probably the most interesting and unique feature of Let me know if that makes sense. |
@paldepind I think this can be closed since we've removed Promise swallowing |
I have been playing with
flyd
and really liked how a promisep
can be passed directly to a streams
ass(p)
, and the "promised" resolved value will simply appear in the stream:However, when I pass another stream
s1
tos
the same way -s(s1)
, the streams
instead emits the string representation of the function implementings1
. That seems unfortunate.Philosophically, I would regard a promise as a special stream which emits the resolved value (or the error). So it would seem natural to have
s(s1)
behaving along the same line, i.e.s
getting all the emitted values froms1
. Would that make sense?Amusingly, that behaviour can be obtained via
s1.map(s)
, wheres
acts like a function, but the other syntaxs(s1)
would be terser and more elegant, perhaps, and in line with the promises.Would be curious to hear other opinions.
The text was updated successfully, but these errors were encountered: