fix: send updates right after create

This commit is contained in:
cha0s 2021-03-14 09:51:03 -05:00
parent a3a0d666dc
commit 81f9c64bd0

View File

@ -56,13 +56,13 @@ export default () => (Resource) => (
const packets = [];
for (let i = 0; i < this._synchronized.length; i++) {
const synchronized = this._synchronized[i];
if (-1 !== this._added.indexOf(synchronized)) {
packets.push(synchronized.createPacket(informed));
}
else if (-1 !== this._removed.indexOf(synchronized)) {
if (-1 !== this._removed.indexOf(synchronized)) {
packets.push(synchronized.destroyPacket(informed));
}
else {
if (-1 !== this._added.indexOf(synchronized)) {
packets.push(synchronized.createPacket(informed));
}
const updatePacket = synchronized.updatePacket(informed);
if (updatePacket) {
packets.push(updatePacket);