mirror of
https://github.com/tiqi-group/pydase.git
synced 2025-06-15 00:37:15 +02:00
feat: adding "emit_update" function
This commit is contained in:
@ -8,3 +8,12 @@ const URL = `ws://${hostname}:${port}/`;
|
||||
console.debug('Websocket: ', URL);
|
||||
|
||||
export const socket = io(URL, { path: '/ws/socket.io', transports: ['websocket'] });
|
||||
|
||||
export const emit_update = (
|
||||
name: string,
|
||||
parent_path: string,
|
||||
value: unknown,
|
||||
callback?: (ack: unknown) => void
|
||||
) => {
|
||||
socket.emit('frontend_update', { name, parent_path, value }, callback);
|
||||
};
|
||||
|
Reference in New Issue
Block a user