Skip to content

Commit

Permalink
added doc for onClose section
Browse files Browse the repository at this point in the history
  • Loading branch information
arnaudgiuliani committed Dec 18, 2024
1 parent 551dae4 commit bb0a33b
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions docs/reference/koin-core/definitions.md
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,17 @@ val presenter : Presenter by inject { parametersOf(view) }

Further reading in the [Injection Parameters Section](/docs/reference/koin-core/injection-parameters)

## Definition Termination - OnClose

You can use the `onClose` function, to add on a definition, the callback once definition closing is called:

```kotlin
class Presenter(val view : View)

val myModule = module {
factory { (view : View) -> Presenter(view) } onClose { // closing callback - it is Presenter }
}
```

## Using definition flags

Expand Down

0 comments on commit bb0a33b

Please sign in to comment.