Skip to content

Introduce Fetch#optional for performing optional fetches - #159

Merged
purrgrammer merged 4 commits into
masterfrom
optional-fetches
Sep 20, 2018
Merged

Introduce Fetch#optional for performing optional fetches#159
purrgrammer merged 4 commits into
masterfrom
optional-fetches

Conversation

@purrgrammer

@purrgrammer purrgrammer commented Sep 19, 2018

Copy link
Copy Markdown
Contributor

You can create Fetch values with Fetch#optional instead of Fetch#apply and you'll get back a Fetch[F, Option[A]] instead of a Fetch[F, A].

I still want to experiment working with optional fetches using OptionT but this change solves #45

  • Update docs
  • Add more testing

@codecov

codecov Bot commented Sep 19, 2018

Copy link
Copy Markdown

Codecov Report

Merging #159 into master will increase coverage by 0.61%.
The diff coverage is 100%.

Impacted file tree graph

@@            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
Impacted Files Coverage Δ
shared/src/main/scala/fetch.scala 92% <100%> (+0.63%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 47cc4e9...8edd14a. Read the comment docs.

Comment thread 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]]]

Copy link
Copy Markdown
Contributor

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]?

@purrgrammer
purrgrammer merged commit 27ea529 into master Sep 20, 2018
@purrgrammer
purrgrammer deleted the optional-fetches branch September 20, 2018 12:25
@JorgeCastilloPrz

Copy link
Copy Markdown

Added to the ongoing redesign of Kollect.

bijancn pushed a commit to bijancn/fetch that referenced this pull request Sep 19, 2019
Introduce Fetch#optional for performing optional fetches
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.

4 participants