public destroyComponent(name as String) as Boolean throws Exception:
Destroys and unregisters one component.
Managed components created through createComponent(...) receive their @DestroyMethod callbacks before removal. Directly registered components are simply unregistered because their lifecycle remains caller-owned.
| Parameter | Description |
|---|---|
name | Registered component name. |
true when a component was removed, otherwise false.
import klyn.di
context = DIContext()
context.createComponent(CacheService.type, "cache")
assert context.destroyComponent("cache")