Skip to content

Commit 2326880

Browse files
authored
docs(msmp): improve clarity on cache usage
1 parent 99e6e81 commit 2326880

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

mcutils-msmp/README.md

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -135,15 +135,12 @@ println(state.attempt, state.nextDelay)
135135
## Advanced Features
136136

137137
### Reactive State Management
138-
Most built-in extensions (like `players`, `gamerules`, `allowList`, etc.) implement the `Syncable` interface. They maintain an internal cache automatically synchronized with the server via events, providing a seamless reactive programming experience.
138+
Some built-in extensions (like `players`, `gamerules`, `allowList`, etc.) implement the `Syncable` interface. They maintain an internal cache automatically synchronized with the server via events.
139139

140140
```kotlin
141-
// Get the current local cache immediately (Not recommended)
141+
// Get the current local cache immediately (Not recommended, use get() to fetch data from server if possible)
142142
val onlinePlayers = client.players.flow.value
143143

144-
// Or fetch latest data from server
145-
val latestPlayers = client.players.get()
146-
147144
// Or observe the state reactively using a Flow
148145
client.players.flow.collect { players ->
149146
println("Currently online: ${players.size}")

0 commit comments

Comments
 (0)