1
submitted 8 months ago* (last edited 8 months ago) by abobla@lemm.ee to c/android_dev@programming.dev

I'm new to using reactive and functional programming in kotlin with libraries. I'm maintaining a project at my company that uses only .orNull() from the arrow.core.Option class.

My question is: why is the project returning the first type instead of the second one?

Single<Option<UserEntity>>
Single<UserEntity?>

Can't the DAO object return a null type if it doesn't find the object on a query such as SELECT * FROM users WHERE id = 1 ?

no comments (yet)
sorted by: hot top controversial new old
there doesn't seem to be anything here
this post was submitted on 02 Sep 2024
1 points (100.0% liked)

Android Development

604 readers
1 users here now

Welcome to the programming.dev Android development community!

The Android robot is reproduced or modified from work created and shared by Google and used according to terms described in the Creative Commons 3.0 Attribution License

founded 2 years ago
MODERATORS