-
Notifications
You must be signed in to change notification settings - Fork 3k
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
WIP: (Proposal) fp and pipe operators #2529
Conversation
Generated by 🚫 dangerJS |
Allows composition of pipeable operator functions to avoid mutating Observable prototype
Now we can assert that two observables that originated from TestScheduler.prototype.createColdObservable or TestScheduler.prototype.createHotObservable are equivalent with `expectObservable(cold('--a--b--c--|')).toBe(cold('--a--b--c--|'))` This feature was mostly added to test the new pipe operators
I predict when this build finishes coveralls is going to totally ✂️ me to pieces! |
Added in |
Okay, this would work. I'm just thinking why have separate |
Right now its just a proof of concept so people can kick the tires on it.
So we can make a decision from there. Sometimes I find it easier to see the
code and prove it out. 😀
On Fri, Apr 7, 2017 at 3:53 AM André Staltz ***@***.***> wrote:
Okay, this would work. I'm just thinking why have separate fp and pipe
sections, we can just choose one (amoung all 3 options) and stick to that,
without generated src files.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#2529 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/ABNdpXD0_5tvRqjetEiX6bo9F6dE-gxGks5rtetggaJpZM4M1A1m>
.
--
Thanks,
David
|
I'm not sure what the In short, I think we should try to guide people to using |
@benlesh what I'm doing over in IxJS land is exactly what David is doing here since I didn't think it was necessary to have the |
5b26242
to
6c00d8b
Compare
Updated PR to purely generate operators on the side (no more commit to source). This also makes the PR a little easier to consume at face value. @benlesh We can still offer the ie: import { map } from 'rxjs/fp'; // or 'rxjs/fp/map'
let a: Obserable<number>;
let b: Observable<string> = a.let(o => map(o, n => n.toString() +'s')); import { map } from 'rxjs/pipe'; // or 'rxjs/pipe/map'
let a: Obserable<number>;
let b: Observable<string> = a.let(map<number, string>(n => n.toString() +'s')); The |
generates the new operators using the existing prototype operators, and a script to generate the resulting fp types.
Just curious (bikeshedding, sorry!), why was |
@davidkpiano you may able to check ongoing discussion for those at #1958. |
@davidkpiano the let name is a holdover from LINQ, but was aliased as letBind at one point. I don't remember when the alias was dropped, but I'd be in favor of adding it back. |
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Description:
This is a code follow up to #2489. I've currently based this off of @benlesh's changes, however (if needed) we can squash / cherry pick or just recreate it since it's mostly a script anyway.
This adds a script that will automatically generate the code to produce the higher level functions from our prototype methods. This makes it a little easier to manage, as we don't have to actually do anything to get these fp functions working (
multicast
was an edge case however we could probably sit and make it work if needed).Related issue (if exists):
#2489, #2034
cc @benlesh @jayphelps @kwonoj @staltz @mattpodwysocki