Inherit the whole state object on message receive
This commit is contained in:
parent
8df32a5726
commit
38c0497a30
@ -87,7 +87,7 @@ export class Communicator {
|
|||||||
const msgJson = JSON.parse(msgStr);
|
const msgJson = JSON.parse(msgStr);
|
||||||
console.log(`Message received on topic ${topic}: ${msgStr}`);
|
console.log(`Message received on topic ${topic}: ${msgStr}`);
|
||||||
console.log(msgJson);
|
console.log(msgJson);
|
||||||
state[msgJson.name].on = msgJson.on;
|
state[msgJson.name] = msgJson;
|
||||||
window.refreshState(window.document, state);
|
window.refreshState(window.document, state);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user