From ed64ce09f4ddbee41e2b65cdab00eaecafba3c93 Mon Sep 17 00:00:00 2001 From: Chris Swithinbank Date: Fri, 28 Aug 2020 12:08:51 +0200 Subject: [PATCH] docs(secret-state): Fix obsolete reference to importing `Game` (#785) --- docs/documentation/secret-state.md | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/docs/documentation/secret-state.md b/docs/documentation/secret-state.md index 11d8c0110..6b469bf18 100644 --- a/docs/documentation/secret-state.md +++ b/docs/documentation/secret-state.md @@ -17,11 +17,10 @@ from that specific player. ```js const game = { - ... - + // ... playerView: (G, ctx, playerID) => { return StripSecrets(G, playerID); - } + }, }; ``` @@ -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: { ... }, @@ -51,7 +50,7 @@ G: { becomes the following for player `1`: -``` +```js G: { players: { '1': { ... }, @@ -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