-
Notifications
You must be signed in to change notification settings - Fork 49
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
Introduce Fetch#optional for performing optional fetches #159
Conversation
Codecov Report
@@ Coverage Diff @@
## master #159 +/- ##
==========================================
+ Coverage 90.5% 91.12% +0.61%
==========================================
Files 5 5
Lines 158 169 +11
Branches 5 5
==========================================
+ Hits 143 154 +11
Misses 15 15
Continue to review full report at Codecov.
|
shared/src/main/scala/fetch.scala
Outdated
case FetchDone(a) => | ||
Done(Some(a)).asInstanceOf[FetchResult[F, Option[A]]] | ||
case FetchMissing() => | ||
Done(None).asInstanceOf[FetchResult[F, Option[A]]] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think we need the cast here. Can we try Option.empty[A]
?
Added to the ongoing redesign of Kollect. |
Introduce Fetch#optional for performing optional fetches
You can create
Fetch
values withFetch#optional
instead ofFetch#apply
and you'll get back aFetch[F, Option[A]]
instead of aFetch[F, A]
.I still want to experiment working with optional fetches using
OptionT
but this change solves #45