Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs(secret-state): Fix obsolete reference to importing Game #785

Merged
merged 1 commit into from
Aug 28, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 9 additions & 10 deletions docs/documentation/secret-state.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,10 @@ from that specific player.

```js
const game = {
...

// ...
playerView: (G, ctx, playerID) => {
return StripSecrets(G, playerID);
}
},
};
```

Expand All @@ -37,7 +36,7 @@ that does the following:
- If `G` contains a `players` object, it removes all keys except
for the one that matches `playerID`.

```
```js
G: {
secret: { ... },

Expand All @@ -51,7 +50,7 @@ G: {

becomes the following for player `1`:

```
```js
G: {
players: {
'1': { ... },
Expand All @@ -62,12 +61,12 @@ G: {
Usage:

```js
import { Game, PlayerView } from 'boardgame.io/core';
import { PlayerView } from 'boardgame.io/core';

const App = Game({
...
playerView: PlayerView.STRIP_SECRETS
});
const game = {
// ...
playerView: PlayerView.STRIP_SECRETS,
};
```

### Disabling moves that manipulate secret state on the client
Expand Down