notes = Generators.observe(notify => {
notify([]);
const socket = new WebSocket(`ws://${host}`);
socket.onerror = event => {
notify(Promise.reject(new Error("socket error")));
};
const nts = {};
socket.onmessage = event => {
const ej = JSON.parse(event.data);
if (ej.Status == 144) {
nts[ej.Data1] = ej;
} else if (ej.Status == 128) {
delete nts[ej.Data1];
}
notify(nts);
};
})