You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
_ <-MyApp.cache.init // prints "warming up cache..." only once
220
+
_ <-MyApp.cache.destroy // prints "clearing cache..."
221
+
} yield ()
222
+
```
223
+
224
+
Notes:
225
+
226
+
- Lifecycle init hooks are invoked by Component during init. Lifecycle destroy hooks are wired into the destroy
227
+
function by the component macros based on the component’s static type, so you don’t need to call destroyWith
228
+
explicitly when using DisposableComponent/AsyncDisposableComponent.
229
+
167
230
## Complete example
168
231
169
232
See [ComponentsExample.scala](https://github.com/AVSystem/scala-commons/blob/master/core/jvm/src/test/scala/com/avsystem/commons/di/ComponentsExample.scala)
0 commit comments