File tree Expand file tree Collapse file tree 1 file changed +19
-1
lines changed Expand file tree Collapse file tree 1 file changed +19
-1
lines changed Original file line number Diff line number Diff line change @@ -122,8 +122,26 @@ GoDice.prototype.onDiceConnected = (diceId, diceInstance) => {
122
122
// die unique identifier
123
123
let dieClass = diceInstance;
124
124
};
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:
126
135
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
+
127
145
` ` ` javascript
128
146
/**
129
147
* To recognize the battery level, override the function "onBatteryLevel" in the GoDice class, with the following parameter:
You can’t perform that action at this time.
0 commit comments