From c1b15e054feb2b2cf08a1f7eb9a6a4d75a1886d6 Mon Sep 17 00:00:00 2001 From: Harsh Shandilya Date: Fri, 31 Jan 2020 20:22:58 +0530 Subject: [PATCH] Prevent incorrect formatting Signed-off-by: Harsh Shandilya --- content/posts/dagger-the-easy-way--part-2.md | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/content/posts/dagger-the-easy-way--part-2.md b/content/posts/dagger-the-easy-way--part-2.md index 482e70f..864d99d 100644 --- a/content/posts/dagger-the-easy-way--part-2.md +++ b/content/posts/dagger-the-easy-way--part-2.md @@ -83,8 +83,9 @@ class WarriorApplication : Application() { Running this on a device will print the following in your logcat -```html -D/WarriorApplication: Warrior 1 D/WarriorApplication: Warrior 2 +```kotlin +D/WarriorApplication: Warrior 1 +D/WarriorApplication: Warrior 2 ``` Totally expected, because unscoped dependencies have no lifecycle in the component, and hence are created every time you ask for one. Let's make them all into Singletons and see how that changes things. @@ -108,7 +109,7 @@ Totally expected, because unscoped dependencies have no lifecycle in the compone Running the same code again, we get -```html +```kotlin D/WarriorApplication: Warrior 1 D/WarriorApplication: Warrior 1 ```