You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Could you clarify whether .match, .filter, and .forEach in your original example are object methods or non-method curried unary functions?
// The original post’s snippet.stream..match({topic: 'available'})// Is this a method call?.filter(status=>['started','exited'].includes(status.type)).forEach(function*(status){yieldsend(status);}));});
Assuming that .match, .filter, and .forEach are actually curried non-method curried unary functions, then—as I mentioned in #202—I am planning to pursue a proposal for a standard Function.pipe function at TC39. With that, one would write this:
Of course I forgot about types entirely when I gave my answer, so no, this would not really satisfy the use-case. It would work ok for JavaScript users, but the entire reason we're using chaining in the first place is to preserve type context for TypeScript users.
The text was updated successfully, but these errors were encountered:
Of course I forgot about types entirely when I gave my answer, so no, this would not really satisfy the use-case. It would work ok for JavaScript users, but the entire reason we're using chaining in the first place is to preserve type context for TypeScript users.
The Function.pipe function would merely be a standardized version of the RxJS and Ramda functions in the language core, and it would easily be annotated with TypeScript types in the same way as the RxJS and Ramda versions.
Apologies for creating a new issue. The old one was locked.
Originally posted by @js-choi in #260 (comment)
Of course I forgot about types entirely when I gave my answer, so no, this would not really satisfy the use-case. It would work ok for JavaScript users, but the entire reason we're using chaining in the first place is to preserve type context for TypeScript users.
The text was updated successfully, but these errors were encountered: