svghmi/svghmi.js
changeset 3624 770c613c424f
parent 3603 f1a00aa8cb3b
child 3625 bb1eff4091ab
--- a/svghmi/svghmi.js	Wed Sep 21 11:51:05 2022 +0200
+++ b/svghmi/svghmi.js	Thu Sep 22 09:42:38 2022 +0200
@@ -46,14 +46,6 @@
     }
 };
 
-// Apply updates recieved through ws.onmessage to subscribed widgets
-function apply_updates() {
-    updates.forEach((value, index) => {
-        dispatch_value(index, value);
-    });
-    updates.clear();
-}
-
 // Called on requestAnimationFrame, modifies DOM
 var requestAnimationFrameID = null;
 function animate() {
@@ -126,14 +118,13 @@
             if(iectype != undefined){
                 let dvgetter = dvgetters[iectype];
                 let [value, bytesize] = dvgetter(dv,i);
-                updates.set(index, value);
+                dispatch_value(index, value);
                 i += bytesize;
             } else {
                 throw new Error("Unknown index "+index);
             }
         };
 
-        apply_updates();
         // register for rendering on next frame, since there are updates
     } catch(err) {
         // 1003 is for "Unsupported Data"