Skip to content

Commit 972f16e

Browse files
docs: Improve storage examples in readme
1 parent 52097e1 commit 972f16e

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

README.md

+2
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,8 @@ const hostId = await peer.createRoom({
5151

5252
// Or, join room
5353
await peer.joinRoom('host-peer-id'); // Rejects if connection fails or times out
54+
55+
// Interact with the synced storage
5456
const currentState = peer.getStorage;
5557
peer.updateStorageArray('players', 'add', { username: 'PeerEnjoyer4', level: 2 }); // Special method to enable simultaneous storage updates for arrays
5658
peer.updateStorage('latestPlayer', 'PeerEnjoyer4'); // Regular synced storage update

0 commit comments

Comments
 (0)