Skip to content

Commit f5f9b55

Browse files
committed
Merge branch 'master' of github.com:DistributedObjectProtocol/dop
2 parents ba586c2 + 45840ea commit f5f9b55

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

README.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44

55
[![npm](https://img.shields.io/npm/v/dop?style=flat-square)](https://www.npmjs.com/package/dop)
66
[![npm bundle size](https://img.shields.io/bundlephobia/minzip/dop?style=flat-square)](https://bundlephobia.com/result?p=dop)
7-
[![Build Status](https://api.travis-ci.org/DistributedObjectProtocol/dop.svg?branch=master&style=flat-square)](https://travis-ci.org/DistributedObjectProtocol/dop)
8-
<!--[![Join the community](https://withspectrum.github.io/badge/badge.svg)](https://spectrum.chat/dop)-->
7+
<!--[![Build Status](https://api.travis-ci.org/DistributedObjectProtocol/dop.svg?branch=master&style=flat-square)](https://travis-ci.org/DistributedObjectProtocol/dop)
8+
[![Join the community](https://withspectrum.github.io/badge/badge.svg)](https://spectrum.chat/dop)-->
99

1010
<br/>
1111
<a href="https://distributedobjectprotocol.org/guide/javascript">https://distributedobjectprotocol.org/</a>
@@ -59,7 +59,9 @@ const store = createStore({ players: 0 })
5959

6060
function subscribeToServerStore(listener) {
6161
// Incrementing number of player as a patch
62-
const listeners = store.applyPatch({ players: store.state.players + 1 })
62+
const listeners = store.applyPatch((state) => {
63+
state.players += 1
64+
})
6365
// We emit the patch to all the subscribers
6466
listeners.forEach(({ listener, patch }) => listener(patch))
6567
// Here we subscribe our client

0 commit comments

Comments
 (0)