Freezed: Remove mandatory orElse

Created on 17 Nov 2020  路  2Comments  路  Source: rrousselGit/freezed

The orElse option in maybeWhen or maybeMap in unions often is not necessary.
Therefore it is only boilerplate code that increases entropy.

I would like to have it removed because it would not decrease experience if its needed every call.

What are your thoughts about that

enhancement

Most helpful comment

The orElse is mandatory because of non-nullable types.

Maybe you want a whenOrNull?

All 2 comments

The orElse is mandatory because of non-nullable types.

Maybe you want a whenOrNull?

Yeah, that would be a compromise.
It would fit my needs very well.

Was this page helpful?
0 / 5 - 0 ratings