Link to code from Dagger part 2 post

Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
This commit is contained in:
Harsh Shandilya 2020-03-06 10:46:58 +05:30
parent fdef60acc7
commit 02685759dd
1 changed files with 2 additions and 0 deletions

View File

@ -11,6 +11,8 @@ socialImage = "uploads/dagger_made_easy_social.webp"
Welcome back! In this post I'm taking a bit of detour from my planned schedule to write about **scoping**. We'll _definitely_ cover constructor injection in the next part :)
> All the code from this post is available on GitHub: [msfjarvis/dagger-the-easy-way](https://github.com/msfjarvis/dagger-the-easy-way/commits/part-2)
Dagger 2 provides `@Scope` as a mechanism to handle scoping. Scoping allows you to keep an object instance for the duration of your scope. This means that no matter how many times the object is requested from Dagger, it returns the same instance.
## Default scopes