diff --git a/README.md b/README.md index 6931aae7..44f93771 100644 --- a/README.md +++ b/README.md @@ -14,13 +14,13 @@ Add the following dependency to your project's build file. For Scala 2.11.x: ```scala -"com.fortysevendeg" %% "fetch" %% "0.2.0" +"com.fortysevendeg" %% "fetch" % "0.2.0" ``` Or, if using Scala.js (0.6.x): ```scala -"com.fortysevendeg" %%% "fetch" %% "0.2.0" +"com.fortysevendeg" %%% "fetch" % "0.2.0" ``` @@ -86,7 +86,7 @@ import fetch.syntax._ val fetchOne: Fetch[String] = fetchString(1) ``` -We'll run our fetches to the ambiend `Id` monad in our examples, let's do some imports. +We'll run our fetches to the ambien `Id` monad in our examples, let's do some imports. ```scala import cats.Id @@ -94,14 +94,14 @@ import fetch.unsafe.implicits._ import fetch.syntax._ ``` -Note that in real-life scenarios you'll want to run a fetch to a concurrency monad, synchronous execution of a fetch +Note that in real-life scenarios you'll want to run a fetch to a concurrency monad such as `Future` or `Task`, synchronous execution of a fetch is only supported in Scala and not Scala.js and is meant for experimentation purposes. Let's run it and wait for the fetch to complete: ```scala fetchOne.runA[Id] -// [111] One ToString 1 +// [42] One ToString 1 // res3: cats.Id[String] = 1 ``` @@ -119,7 +119,7 @@ When executing the above fetch, note how the three identities get batched and th ```scala fetchThree.runA[Id] -// [111] Many ToString OneAnd(1,List(2, 3)) +// [42] Many ToString OneAnd(1,List(2, 3)) // res5: cats.Id[(String, String, String)] = (1,2,3) ``` @@ -154,12 +154,12 @@ And now we can easily receive data from the two sources in a single fetch. val fetchMulti: Fetch[(String, Int)] = (fetchString(1) |@| fetchLength("one")).tupled ``` -Note how the two independent data fetches are run in parallel, minimizing the latency cost of querying the two data sources. +Note how the two independent data fetches run in parallel, minimizing the latency cost of querying the two data sources. ```scala fetchMulti.runA[Id] -// [111] One ToString 1 -// [112] One Length one +// [42] One ToString 1 +// [43] One Length one // res7: cats.Id[(String, Int)] = (1,3) ``` @@ -178,6 +178,6 @@ While running it, notice that the data source is only queried once. The next tim ```scala fetchTwice.runA[Id] -// [111] One ToString 1 +// [42] One ToString 1 // res8: cats.Id[(String, String)] = (1,1) ```