Skip to content

Commit 52ededa

Browse files
committed
docs: fixup docs
Signed-off-by: Nicklas Lundin <[email protected]>
1 parent 79aa5ae commit 52ededa

File tree

1 file changed

+13
-13
lines changed

1 file changed

+13
-13
lines changed

README.md

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,19 @@ If the hook you're looking for hasn't been created yet, see the [develop a hook]
118118

119119
Once you've added a hook as a dependency, it can be registered at the global, client, or flag invocation level.
120120

121+
```kotlin
122+
// add a hook globally, to run on all evaluations
123+
OpenFeatureAPI.addHooks(listOf(ExampleHook()))
124+
125+
// add a hook on this client, to run on all evaluations made by this client
126+
val client = OpenFeatureAPI.getClient()
127+
client.addHooks(listOf(ExampleHook()))
128+
129+
// add a hook for this evaluation only
130+
val retval = client.getBooleanValue(flagKey, false,
131+
FlagEvaluationOptions(listOf(ExampleHook())))
132+
```
133+
121134
### Tracking
122135

123136
The [tracking API](https://openfeature.dev/specification/sections/tracking/) allows you to use
@@ -143,19 +156,6 @@ OpenFeatureAPI.getClient().track(
143156

144157
Tracking is optionally implemented by Providers.
145158

146-
147-
```kotlin
148-
// add a hook globally, to run on all evaluations
149-
OpenFeatureAPI.addHooks(listOf(ExampleHook()))
150-
151-
// add a hook on this client, to run on all evaluations made by this client
152-
val client = OpenFeatureAPI.getClient()
153-
client.addHooks(listOf(ExampleHook()))
154-
155-
// add a hook for this evaluation only
156-
val retval = client.getBooleanValue(flagKey, false,
157-
FlagEvaluationOptions(listOf(ExampleHook())))
158-
```
159159
### Logging
160160

161161
Logging customization is not yet available in the Kotlin SDK.

0 commit comments

Comments
 (0)