Skip to content
This repository was archived by the owner on Aug 17, 2020. It is now read-only.

mapToOneOrNull replaced by mapToOneOrDefault#56

Merged
JakeWharton merged 1 commit intosquare:masterfrom
phajduk:added-maptooneordefault
Sep 9, 2015
Merged

mapToOneOrNull replaced by mapToOneOrDefault#56
JakeWharton merged 1 commit intosquare:masterfrom
phajduk:added-maptooneordefault

Conversation

@phajduk
Copy link
Copy Markdown
Contributor

@phajduk phajduk commented Sep 2, 2015

Solves #55

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.

You still need this boolean but it should probably be called emitDefault. null is a valid default value and right now there's no way to emit it.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

We can still emit null by passing it to the mapToOneOrDefault method (null passed as a second argument). Eventually, there could be two methods mapToOneOrDefault and mapToOneOrNull as it was previously.

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.

But then you break mapToOne which does not emit anything on empty.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Yeah. Fixed.

@JakeWharton
Copy link
Copy Markdown
Collaborator

Can you squash to one commit? If not, I can do it upon merge.

@phajduk
Copy link
Copy Markdown
Contributor Author

phajduk commented Sep 9, 2015

Squashed.

JakeWharton added a commit that referenced this pull request Sep 9, 2015
mapToOneOrNull replaced by mapToOneOrDefault
@JakeWharton JakeWharton merged commit b36fbbd into square:master Sep 9, 2015
@JakeWharton
Copy link
Copy Markdown
Collaborator

Thanks!

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.

2 participants