Proyectos de Subversion LeadersLinked - SPA

Rev

Rev 994 | Rev 1067 | Ir a la última revisión | Mostrar el archivo completo | | | Autoría | Ultima modificación | Ver Log |

Rev 994 Rev 1003
Línea 3... Línea 3...
3
import { useDispatch } from 'react-redux'
3
import { useDispatch } from 'react-redux'
4
import { addNotification } from '../redux/notification/notification.actions'
4
import { addNotification } from '../redux/notification/notification.actions'
Línea 5... Línea 5...
5
 
5
 
6
const useFetch = (url = '', defaultValue = null) => {
6
const useFetch = (url = '', defaultValue = null) => {
7
  const [data, setData] = useState(defaultValue)
7
  const [data, setData] = useState(defaultValue)
8
  const [isLoading, setIsLoading] = useState(false)
8
  const [isLoading, setIsLoading] = useState(true)
Línea 9... Línea 9...
9
  const dispatch = useDispatch()
9
  const dispatch = useDispatch()
10
 
-
 
11
  const getResources = (url = '') => {
-
 
12
    setIsLoading(true)
10
 
13
 
11
  const getResources = (url = '') => {
14
    axios
12
    axios
15
      .get(url)
13
      .get(url)
16
      .then(({ data }) => {
14
      .then(({ data }) => {