Skip to content

Commit c14aebc

Browse files
Apply suggestions from code review
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
1 parent 46a3ae5 commit c14aebc

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

docs/state_structure/shared_state.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ A token can be any string that uniquely identifies a group of clients that shoul
2222
```md alert warning
2323
# Linked token cannot contain underscore (_) characters.
2424

25-
Underscore characters are currently used as an internal delimeter for tokens and will raise an exception if used for linked states.
25+
Underscore characters are currently used as an internal delimiter for tokens and will raise an exception if used for linked states.
2626

2727
This is a temporary restriction and will be removed in a future release.
2828
```
@@ -71,7 +71,7 @@ Whenever the shared state is updated, any computed vars depending on it will be
7171

7272
### Identifying Clients
7373

74-
Each client linked to a shared state can be uniquely identified by their `self.router.session.client_token`. Shared state events should _never_ relying on identifiers passed in as parameters, as these can be spoofed from the client. Instead, always use the `client_token` to identify the client triggering the event.
74+
Each client linked to a shared state can be uniquely identified by their `self.router.session.client_token`. Shared state events should _never_ rely on identifiers passed in as parameters, as these can be spoofed from the client. Instead, always use the `client_token` to identify the client triggering the event.
7575

7676
```python demo exec
7777
import uuid
@@ -185,7 +185,7 @@ Use async computed vars with `get_state` to access shared state data from privat
185185
```python
186186
class UserGameState(rx.State):
187187
@rx.var
188-
def player_piece(self) -> str | None:
188+
async def player_piece(self) -> str | None:
189189
shared_state = await self.get_state(SharedGameState)
190190
return shared_state._players.get(self.router.session.client_token)
191191
```

0 commit comments

Comments
 (0)