mirror of
https://github.com/Steffo99/todocolors.git
synced 2024-11-22 00:04:18 +00:00
Remove unused imports
This commit is contained in:
parent
f11dde412c
commit
08aecfa53e
1 changed files with 2 additions and 2 deletions
|
@ -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);
|
||||||
|
|
Loading…
Reference in a new issue