Proyectos de Subversion LeadersLinked - Antes de SPA

Rev

Rev 4011 | Mostrar el archivo completo | | | Autoría | Ultima modificación | Ver Log |

Rev 4011 Rev 4012
Línea 1... Línea 1...
1
import { useEffect, useState } from 'react'
1
import { useEffect, useState } from 'react'
2
import { useDispatch } from 'react-redux';
2
import { useDispatch } from 'react-redux';
3
import { addNotification } from '../redux/notification/notification.actions';
3
import { addNotification } from '../redux/notification/notification.actions';
4
import { axios } from '../utils';
4
import { axios } from '../utils';
Línea 5... Línea 5...
5
 
5
 
Línea 6... Línea 6...
6
const useFetchHelper = (url = '') => {
6
const useFetchHelper = (url = '', defaultState = []) => {
7
 
7
 
8
    const [state, setState] = useState(null);
8
    const [state, setState] = useState(defaultState);
Línea 9... Línea 9...
9
    const [loading, setLoading] = useState(false);
9
    const [loading, setLoading] = useState(false);
10
    const dispatch = useDispatch()
10
    const dispatch = useDispatch()