refactor: gatherWithLatus
This commit is contained in:
parent
49859f5d58
commit
2eb590859f
|
@ -13,5 +13,8 @@ export default {
|
|||
'@avocado/traits': gatherWithLatus(
|
||||
require.context('./traits', false, /\.js$/),
|
||||
),
|
||||
'@latus/socket/packets': gatherWithLatus(
|
||||
require.context('./packets', false, /\.js$/),
|
||||
),
|
||||
},
|
||||
};
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import {BundlePacket, Packet} from '@latus/socket';
|
||||
|
||||
export default class LayersUpdateLayerPacket extends Packet {
|
||||
export default () => class LayersUpdateLayerPacket extends Packet {
|
||||
|
||||
static packData(data) {
|
||||
for (let i = 0; i < data.length; i++) {
|
||||
|
@ -27,4 +27,4 @@ export default class LayersUpdateLayerPacket extends Packet {
|
|||
return data;
|
||||
}
|
||||
|
||||
}
|
||||
};
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import {BundlePacket} from '@latus/socket';
|
||||
import {SynchronizedUpdatePacket} from '@avocado/s13n';
|
||||
|
||||
export default class RoomUpdateLayers extends SynchronizedUpdatePacket {
|
||||
export default () => class RoomUpdateLayers extends SynchronizedUpdatePacket {
|
||||
|
||||
static packData(data) {
|
||||
// eslint-disable-next-line no-param-reassign
|
||||
|
@ -21,4 +21,4 @@ export default class RoomUpdateLayers extends SynchronizedUpdatePacket {
|
|||
return data;
|
||||
}
|
||||
|
||||
}
|
||||
};
|
||||
|
|
|
@ -6,7 +6,7 @@ const decorate = compose(
|
|||
Vector.Packer('position'),
|
||||
);
|
||||
|
||||
class TilesUpdatePacket extends Packet {
|
||||
export default () => class TilesUpdatePacket extends decorate(Packet) {
|
||||
|
||||
static get data() {
|
||||
return {
|
||||
|
@ -14,6 +14,4 @@ class TilesUpdatePacket extends Packet {
|
|||
};
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
export default decorate(TilesUpdatePacket);
|
||||
};
|
||||
|
|
|
@ -1022,8 +1022,8 @@
|
|||
|
||||
"@latus/core@2.0.0", "@latus/core@^2.0.0":
|
||||
version "2.0.0"
|
||||
resolved "https://npm.i12e.cha0s.io/@latus%2fcore/-/core-2.0.0.tgz#2907182686e134893c140e96f743febbe0b1893f"
|
||||
integrity sha512-YoqRv+H5cUbpDWs+pc7L/bHdTqxaMH05sOPGrZPgDe3akOmF93X1Wq/lECRYs88d4dgLc7s6MauGhHRu5C3EcQ==
|
||||
resolved "https://npm.i12e.cha0s.io/@latus%2fcore/-/core-2.0.0.tgz#b98b3cecd37e11cfecc3dd25c900b34232c98cf9"
|
||||
integrity sha512-mVAuCJJzkyXDZjCcZ97+vuForcZl7lIiaxwqHdm73Fo/CgKoCqNXge96LfJ8ZHx+3ypx5Zz3C2+0em1dvEvFLw==
|
||||
dependencies:
|
||||
debug "4.3.1"
|
||||
js-yaml "3.14.0"
|
||||
|
|
Loading…
Reference in New Issue
Block a user