Skip to content

Commit 04d9ac4

Browse files
committed
README update
1 parent 027ac3b commit 04d9ac4

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

Yoshi/QAKit/README.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,17 @@ Then, register the callback and environments to the environment manager.
3232

3333
```swift
3434

35+
// If you want to get the callback when environment is initialized, register the callback when initializing the manager.
3536
let environmentManager = YoshiEnvironmentManager(environments: environmentOptions) { (environment) in
3637
/// Do something when environment is changed.
3738
}
3839

40+
// Or, you can register the callback separately.
41+
// Notice that this way callback won't be invoked when environment is retrieved from the archive.
42+
environmentManager.onEnvironmentChange = { (environment) in
43+
/// Do something when environment is changed.
44+
}
45+
3946
```
4047

4148
Finally, construct the environment menu and setup it up like other Yoshi menus:

0 commit comments

Comments
 (0)