Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 4e54372

Browse files
authored
Updated readme
1 parent 65d37e6 commit 4e54372

File tree

1 file changed

+19
-1
lines changed

1 file changed

+19
-1
lines changed

README.md

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,8 +122,26 @@ GoDice.prototype.onDiceConnected = (diceId, diceInstance) => {
122122
// die unique identifier
123123
let dieClass = diceInstance;
124124
};
125-
```
125+
```
126+
127+
```javascript
128+
/**
129+
* To recognize when a die has disconneted, override the function "onDiceDisconnected" in the GoDice class, with the following parameter:
130+
* @param {string} diceID - the die unique identifier
131+
* @param {GoDice class} diceInstance - the die class instance
132+
*/
133+
134+
// example:
126135

136+
GoDice.prototype.onDiceDisconnected = (diceId, diceInstance) => {
137+
// die unique identifier
138+
let dieIdentifier = diceID;
139+
140+
// die unique identifier
141+
let dieClass = diceInstance;
142+
};
143+
```
144+
127145
```javascript
128146
/**
129147
* To recognize the battery level, override the function "onBatteryLevel" in the GoDice class, with the following parameter:

0 commit comments

Comments
 (0)