diff --git a/src/api/hooks.js b/src/api/hooks.js index f3f5746..e873ef7 100644 --- a/src/api/hooks.js +++ b/src/api/hooks.js @@ -5,14 +5,10 @@ * See /LICENSE for more information. */ -import { - useCallback, useEffect, useReducer, useState, -} from "react"; +import { useCallback, useEffect, useReducer, useState, } from "react"; import { ForisURLs } from "forisUrls"; -import { - API_ACTIONS, API_METHODS, API_STATE, getErrorPayload, HEADERS, TIMEOUT, -} from "./utils"; +import { API_ACTIONS, API_METHODS, API_STATE, getErrorPayload, HEADERS, TIMEOUT, } from "./utils"; const DATA_METHODS = ["POST", "PATCH", "PUT"]; @@ -93,7 +89,7 @@ export { useAPIGet, useAPIPost, useAPIPatch, useAPIPut, useAPIDelete, }; -export function useAPIPolling(endpoint, delay) { +export function useAPIPolling(endpoint, delay = 1000) { // delay ms const [state, setState] = useState({ state: API_STATE.INIT }); const [getState, get] = useAPIGet(endpoint);