Skip to content

Commit

Permalink
Merge 4759da3 into 2586022
Browse files Browse the repository at this point in the history
  • Loading branch information
delucis committed Aug 28, 2020
2 parents 2586022 + 4759da3 commit 42aae8f
Showing 1 changed file with 9 additions and 10 deletions.
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

0 comments on commit 42aae8f

Please sign in to comment.