mirror of
https://github.com/OpenNebula/one.git
synced 2025-03-16 22:50:10 +03:00
F OpenNebula/one#5422: Lint
This commit is contained in:
parent
1d5a8f59b3
commit
1f5a73125a
@ -16,7 +16,6 @@
|
||||
import { useReducer, useCallback, useEffect, useRef, ReducerState, ReducerAction } from 'react'
|
||||
import { fakeDelay } from 'client/utils'
|
||||
|
||||
/** @enum {string} Status of request */
|
||||
const STATUS = {
|
||||
INIT: 'INIT',
|
||||
PENDING: 'PENDING',
|
||||
@ -153,7 +152,7 @@ const useFetch = (request, socket) => {
|
||||
return fakeDelay(delay).then(() => doFetch(payload, reload))
|
||||
}, [request])
|
||||
|
||||
return { ...state, fetchRequest, STATUS, ACTIONS }
|
||||
return { ...state, fetchRequest, STATUS }
|
||||
}
|
||||
|
||||
export default useFetch
|
||||
|
@ -16,7 +16,6 @@
|
||||
import { useReducer, useCallback, useEffect, useRef, ReducerState, ReducerAction } from 'react'
|
||||
import { fakeDelay } from 'client/utils'
|
||||
|
||||
/** @enum {string} Status of request */
|
||||
const STATUS = {
|
||||
INIT: 'INIT',
|
||||
PENDING: 'PENDING',
|
||||
@ -123,7 +122,7 @@ const useFetchAll = () => {
|
||||
* @param {number} options.delay - Delay to trigger the request
|
||||
* @returns {Promise} - Returns a promise with responses or error
|
||||
*/
|
||||
(requests, options = {}) => {
|
||||
async (requests, options = {}) => {
|
||||
const { reload = false, delay = 0 } = options
|
||||
|
||||
if (!(Number.isInteger(delay) && delay >= 0)) {
|
||||
@ -132,10 +131,11 @@ const useFetchAll = () => {
|
||||
If you're using it as a function, it must also return a number >= 0.`)
|
||||
}
|
||||
|
||||
return fakeDelay(delay).then(() => doFetches(requests, reload))
|
||||
await fakeDelay(delay)
|
||||
return await doFetches(requests, reload)
|
||||
}, [])
|
||||
|
||||
return { ...state, fetchRequestAll, STATUS, ACTIONS }
|
||||
return { ...state, fetchRequestAll, STATUS }
|
||||
}
|
||||
|
||||
export default useFetchAll
|
||||
|
Loading…
x
Reference in New Issue
Block a user