-
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
Documentation #24
Documentation #24
Conversation
mixing low-level (optimization) and high-level (business logic with the data | ||
we read) concerns. | ||
|
||
Fetch is a library that allows your data fetches to be written in a concise, |
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.
This should be the first paragraph
@raulraja i've changed many examples to use |
|
||
We are now ready to declare and run fetches. We need to provide Fetch with a target | ||
monad when we want to execute a fetch. We'll be using `Id` for now, make sure to import | ||
`fetch.implicits._` since Fetch needs an instance of `MonadError[Id, Throwable]` for running |
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.
Also for any other Monads. We should state right here that Fetch comes with builtin impls of MonadError for Id, Task, Future, etc...
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.
Added it just below this paragraph.
|
||
## Implementing a custom cache | ||
|
||
The default cache is implemented as an in-memory map, but users are free to use their own caches when running a fetch. Your cache should implement the `DataSourceCache` trait, and after that you can pass it to Fetch's `run` methods. |
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.
Perhaps worth mentioning here that the cache is trampolined inside a state monad when evaluating a Fetch so people understand they can easily implement caches with inmutable data structures and not mutable maps.
|
||
## cats | ||
|
||
Fetch is built using cats' Free monad construction and thus works out of the box with |
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.
Mention to tree optimization?
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.
Done!
Some small comments, once addressed this LGTM and it's ready for lang review. Awesome work! |
All your comments addressed, feel free to merge @raulraja ✨ |
Great work @dialelo. |
small language changes
Update docs.md
@raulraja take a look and let me know your suggestions please.