Skip to content
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

feat(operator): add skipWhile operator #703

Closed
wants to merge 1 commit into from

Conversation

jinroh
Copy link
Contributor

@jinroh jinroh commented Nov 11, 2015

(#696)

Waiting for your reviews !

@jinroh jinroh force-pushed the skipwhile branch 3 times, most recently from 828ae99 to ac093f7 Compare November 11, 2015 14:15
var expected = '----------------|';

expectObservable(source.skipWhile(function () { return {}; })).toBe(expected);
});
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you add a test case where the predicate throws an error?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Forgot this one !

@jinroh
Copy link
Contributor Author

jinroh commented Nov 11, 2015

In RxJS4, the predicate function takes as third argument (after the value and index) the observable object being subscribed...

I'm not sure what is the purpose of this and could not find any... Do you think we need to keep it ?

}

_next(value: T): void {
const destination = this.destination;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Like for everything else, you could store const skipping = this.skipping since it's used multiple times.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not really because it is mutated on line 40.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, correct.

@kwonoj
Copy link
Member

kwonoj commented Nov 11, 2015

I think PR's OK. @jinroh , you're fast! :)

@benlesh
Copy link
Member

benlesh commented Nov 11, 2015

I'm not sure what is the purpose of this and could not find any... Do you think we need to keep it ?

I believe we kept it in filter and map as well.. so we should probably keep it here too... however, I totally agree that it's unnecessary.

import {errorObject} from '../util/errorObject';
import {bindCallback} from '../util/bindCallback';

export function skipWhile<T>(predicate: (x: T, index: number) => boolean, thisArg?: any) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should define a return value of : Observable<T>

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done.

@jinroh
Copy link
Contributor Author

jinroh commented Nov 11, 2015

@Blesh I don't think you did.

I think we should drop this behaviour...

@kwonoj
Copy link
Member

kwonoj commented Nov 11, 2015

Actually, there are mixture currently, refer count. Seems it's good time to have conclusion for unified behavior.

@benlesh
Copy link
Member

benlesh commented Nov 12, 2015

Oops didn't mean to close. Fat fingers.

Anyhow...

I think we should drop this behaviour

That's fine. It really doesn't make much sense anyhow.

@kwonoj
Copy link
Member

kwonoj commented Nov 12, 2015

That's fine. It really doesn't make much sense anyhow.

: +1 too. Maybe can discuss later to find if anyone has usecase.

@kwonoj
Copy link
Member

kwonoj commented Nov 12, 2015

I think most of issues in this PR's now settled down, will merge in around hr. (having around hr of buffer just in case if @Blesh might have some additional suggestion)

@benlesh
Copy link
Member

benlesh commented Nov 12, 2015

@kwonoj 👍 LGTM

@kwonoj
Copy link
Member

kwonoj commented Nov 12, 2015

Merged with a2244e0. Appreciate for all effort & taking time, @jinroh

@kwonoj kwonoj closed this Nov 12, 2015
@lock lock bot locked as resolved and limited conversation to collaborators Jan 18, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants