@colyseus/schema 4.0.9 → 4.0.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/build/index.js
CHANGED
|
@@ -5191,7 +5191,7 @@
|
|
|
5191
5191
|
const removeOnAdd = () => removeHandler();
|
|
5192
5192
|
const collection = instance[propertyName];
|
|
5193
5193
|
// Collection not available yet. Listen for its availability before attaching the handler.
|
|
5194
|
-
if (collection
|
|
5194
|
+
if (!collection || collection[$refId] === undefined) {
|
|
5195
5195
|
removeHandler = this.addCallback(instance[$refId], propertyName, (value, _) => {
|
|
5196
5196
|
if (value !== null && value !== undefined) {
|
|
5197
5197
|
removeHandler = this.addCallback(value[$refId], operation, handler);
|
|
@@ -5445,7 +5445,7 @@
|
|
|
5445
5445
|
if (roomOrDecoder instanceof Decoder) {
|
|
5446
5446
|
return new StateCallbackStrategy(roomOrDecoder);
|
|
5447
5447
|
}
|
|
5448
|
-
else if (roomOrDecoder.serializer
|
|
5448
|
+
else if ('decoder' in roomOrDecoder.serializer) {
|
|
5449
5449
|
return new StateCallbackStrategy(roomOrDecoder.serializer.decoder);
|
|
5450
5450
|
}
|
|
5451
5451
|
else {
|
|
@@ -5464,7 +5464,7 @@
|
|
|
5464
5464
|
if (roomOrDecoder instanceof Decoder) {
|
|
5465
5465
|
return getDecoderStateCallbacks(roomOrDecoder);
|
|
5466
5466
|
}
|
|
5467
|
-
else if (roomOrDecoder.serializer
|
|
5467
|
+
else if ('decoder' in roomOrDecoder.serializer) {
|
|
5468
5468
|
return getDecoderStateCallbacks(roomOrDecoder.serializer.decoder);
|
|
5469
5469
|
}
|
|
5470
5470
|
},
|
package/build/index.mjs
CHANGED
|
@@ -5185,7 +5185,7 @@ class StateCallbackStrategy {
|
|
|
5185
5185
|
const removeOnAdd = () => removeHandler();
|
|
5186
5186
|
const collection = instance[propertyName];
|
|
5187
5187
|
// Collection not available yet. Listen for its availability before attaching the handler.
|
|
5188
|
-
if (collection
|
|
5188
|
+
if (!collection || collection[$refId] === undefined) {
|
|
5189
5189
|
removeHandler = this.addCallback(instance[$refId], propertyName, (value, _) => {
|
|
5190
5190
|
if (value !== null && value !== undefined) {
|
|
5191
5191
|
removeHandler = this.addCallback(value[$refId], operation, handler);
|
|
@@ -5439,7 +5439,7 @@ const Callbacks = {
|
|
|
5439
5439
|
if (roomOrDecoder instanceof Decoder) {
|
|
5440
5440
|
return new StateCallbackStrategy(roomOrDecoder);
|
|
5441
5441
|
}
|
|
5442
|
-
else if (roomOrDecoder.serializer
|
|
5442
|
+
else if ('decoder' in roomOrDecoder.serializer) {
|
|
5443
5443
|
return new StateCallbackStrategy(roomOrDecoder.serializer.decoder);
|
|
5444
5444
|
}
|
|
5445
5445
|
else {
|
|
@@ -5458,7 +5458,7 @@ const Callbacks = {
|
|
|
5458
5458
|
if (roomOrDecoder instanceof Decoder) {
|
|
5459
5459
|
return getDecoderStateCallbacks(roomOrDecoder);
|
|
5460
5460
|
}
|
|
5461
|
-
else if (roomOrDecoder.serializer
|
|
5461
|
+
else if ('decoder' in roomOrDecoder.serializer) {
|
|
5462
5462
|
return getDecoderStateCallbacks(roomOrDecoder.serializer.decoder);
|
|
5463
5463
|
}
|
|
5464
5464
|
},
|