1
0
mirror of https://gitlab.nic.cz/turris/reforis/foris-js.git synced 2025-08-05 20:23:46 +02:00

Format all files with Prettier

This commit is contained in:
Aleksandr Gumroian
2020-08-18 15:39:00 +02:00
parent e41da48b1a
commit f8726e6012
80 changed files with 933 additions and 804 deletions

View File

@@ -7,7 +7,12 @@
import { useEffect, useState } from "react";
export function useWSForisModule(ws, module, action = "update_settings", controllerID) {
export function useWSForisModule(
ws,
module,
action = "update_settings",
controllerID
) {
const [data, setData] = useState(null);
useEffect(() => {
@@ -18,14 +23,16 @@ export function useWSForisModule(ws, module, action = "update_settings", control
function callback(message) {
// Accept only messages addressed to device with passed controller ID.
if (controllerID !== undefined && controllerID !== message.controller_id) {
if (
controllerID !== undefined &&
controllerID !== message.controller_id
) {
return;
}
setData(message.data);
}
ws.subscribe(module)
.bind(module, action, callback);
ws.subscribe(module).bind(module, action, callback);
return () => {
ws.unbind(module, action, callback);