feat: adding "emit_update" function

This commit is contained in:
Mose Müller
2023-08-02 12:06:22 +02:00
parent c5bbaad58d
commit 80fe1051f1
6 changed files with 27 additions and 37 deletions

View File

@@ -1,6 +1,6 @@
import React, { useEffect, useRef } from 'react';
import { InputGroup, Form, Row, Col } from 'react-bootstrap';
import { socket } from '../socket';
import { emit_update } from '../socket';
import { DocStringComponent } from './DocStringComponent';
interface EnumComponentProps {
@@ -21,11 +21,7 @@ export const EnumComponent = React.memo((props: EnumComponentProps) => {
const { name, parent_path, value, docString, enumDict } = props;
const handleValueChange = (newValue: string) => {
socket.emit('frontend_update', {
name: name,
parent_path: parent_path,
value: newValue
});
emit_update(name, parent_path, newValue);
};
return (