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(core): support refinements in filter operator #294

Merged
merged 1 commit into from
Jun 25, 2019

Conversation

raveclassic
Copy link
Contributor

@raveclassic raveclassic commented Jun 25, 2019

Hi, this PR adds support for type refinements in filter operator:

type Foo = { foo: string }
const isFoo = (obj: any): obj is Foo => typeof obj['foo'] === 'string';
declare const source: Stream<unknown>;
const foo = filter(isFoo)(source) // Stream<Foo>

Copy link
Member

@briancavalier briancavalier left a comment

Choose a reason for hiding this comment

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

👍 Thanks!

@briancavalier briancavalier merged commit 7b47c02 into mostjs:master Jun 25, 2019
@raveclassic raveclassic deleted the filter-refinements branch June 27, 2019 10:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants