1
Fork 0
mirror of https://github.com/Steffo99/todocolors.git synced 2024-11-25 17:54:18 +00:00

Remove unused imports

This commit is contained in:
Steffo 2023-08-16 16:46:19 +02:00
parent f11dde412c
commit 08aecfa53e
Signed by: steffo
GPG key ID: 2A24051445686895

View file

@ -1,6 +1,6 @@
'use client'; 'use client';
import {useState, useCallback, useEffect, useReducer, Reducer} from "react" import {useCallback, useEffect, useReducer, Reducer} from "react"
export interface WebSocketHandlerParams<E extends Event> { export interface WebSocketHandlerParams<E extends Event> {
event: E, event: E,
@ -52,7 +52,7 @@ function wsReducer(prevState: WebSocketState, action: WebSocketAction) {
} }
export function useWs(url: string | undefined, {onclose, onerror, onmessage, onopen}: WebSocketHandlers) { export function useWs(url: string | undefined, {onclose, onerror, onmessage, onopen}: WebSocketHandlers) {
const [{webSocket, webSocketState, webSocketBackoffMs, nextBackOffMs}, dispatch] = useReducer<Reducer<WebSocketState, WebSocketAction>>(wsReducer, {webSocket: undefined, webSocketState: undefined, webSocketBackoffMs: undefined, nextBackOffMs: 1000}) const [{webSocket, webSocketState, webSocketBackoffMs}, dispatch] = useReducer<Reducer<WebSocketState, WebSocketAction>>(wsReducer, {webSocket: undefined, webSocketState: undefined, webSocketBackoffMs: undefined, nextBackOffMs: 1000})
const closeWebSocket = useCallback(() => { const closeWebSocket = useCallback(() => {
console.debug("[useWebSocket] Closing WebSocket:", webSocket); console.debug("[useWebSocket] Closing WebSocket:", webSocket);