Skip to content

Add withFilter to Iterant#1132

Merged
Avasil merged 1 commit into
monix:masterfrom
mantasindrasius:master
Feb 19, 2020
Merged

Add withFilter to Iterant#1132
Avasil merged 1 commit into
monix:masterfrom
mantasindrasius:master

Conversation

@mantasindrasius
Copy link
Copy Markdown
Contributor

@mantasindrasius mantasindrasius commented Feb 18, 2020

Cousin of #1129

Copy link
Copy Markdown
Collaborator

@Avasil Avasil left a comment

Choose a reason for hiding this comment

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

Thank you @mantasindrasius

@Avasil Avasil merged commit eceabda into monix:master Feb 19, 2020
/** Filters the iterant by the given predicate function, returning
* only those elements that match.
*
* Example: {{{
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

In this ScalaDoc we could simply mention that it's an alias of filter, which is better because people need to know that the main function is.

If we mention anything in this documentation, we should mention the reason for its existence (i.e. to make it compatible with for-comprehensions).

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

In Observable PR: #1129
I did

  /** Alias to [[filter]] to support syntax in for comprehension, i.e.
    *
    * {{{
    *   case class Person(age: Long)
    *
    *   val peopleObservable: Observable[Person] =
    *     Observable.range(1, 100).map(Person.apply)
    *
    *   for {
    *     adult <- peopleObservable if adult.age >= 18
    *   } yield adult
    * }}}
    */

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Yeah, that's good.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Okay, I'll just update that PR since I have already merged this one

mdedetrich pushed a commit to mdedetrich/monix that referenced this pull request Mar 28, 2020
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