Skip to content
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

error: could not find implicit value for parameter DS: fetch.DataSource[UserId, A] #11

Open
mikoSL opened this issue Jul 25, 2018 · 0 comments

Comments

@mikoSL
Copy link

mikoSL commented Jul 25, 2018

Hello,

when I tried to run the code
def getUser(id: UserId): Fetch[User] = Fetch(id) // or, more explicitly: Fetch(id)(UserSource)

It showed error: error: could not find implicit value for parameter DS: fetch.DataSource[UserId, A].

I have tried another example from Fetch github
`implicit object ToStringSource extends DataSource[Int, String]{
override def name = "ToString"

override def fetchOne(id: Int): Query[Option[String]] = {
Query.sync({
println(s"[${Thread.currentThread.getId}] One ToString $id")
Option(id.toString)
})
}
override def fetchMany(ids: NonEmptyList[Int]): Query[Map[Int, String]] = {
Query.sync({
println(s"[${Thread.currentThread.getId}] Many ToString $ids")
ids.toList.map(i => (i, i.toString)).toMap
})
}
}

def fetchString(n: Int): Fetch[String] = Fetch(n) // or, more explicitly: Fetch(n)(ToStringSource)`

It had the same error. Errors: could not find implicit value for parameter DS: fetch.DAtaSource[Int, A].

Fetch is a very nice tool, I really want to learn how to use it, but I am stuck here.
I can not find any similar question from google.
Can you please help?

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

No branches or pull requests

1 participant