Skip to content

Instantly share code, notes, and snippets.

Created August 3, 2017 06:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/9aea45ed67b10762b18f49a229ba6bc1 to your computer and use it in GitHub Desktop.
Save anonymous/9aea45ed67b10762b18f49a229ba6bc1 to your computer and use it in GitHub Desktop.
the description for this gist
val categoriesFetcher: Fetcher[ShopRepository, Category, (Seq[CategoryId], Category), CategoryId] = Fetcher.relCaching(
(repo: ShopRepository, ids: Seq[CategoryId]) => repo.categories(ids),
(repo: ShopRepository, ids: RelationIds[Category]) => repo.categoriesByProducts(ids(categoriesForProductRelation))
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment