Proyectos de Subversion LeadersLinked - Antes de SPA

Rev

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

Rev 6359 Rev 6360
Línea 1... Línea 1...
1
import { axios } from '../../utils'
1
import { axios } from '../../utils'
2
import { feedActionTypes } from './feed.types'
2
import { feedActionTypes } from './feed.types'
Línea 3... Línea 3...
3
 
3
 
4
export const setTimelineUrl = (url) => {
-
 
5
  return {
4
export const setTimelineUrl = (url) => ({
6
    type: feedActionTypes.SET_TIMELINE_URL,
5
  type: feedActionTypes.SET_TIMELINE_URL,
7
    payload: url,
-
 
8
  }
6
  payload: url,
Línea 9... Línea 7...
9
}
7
})
10
 
-
 
11
export const loadFeeds = () => {
8
 
12
  return {
-
 
13
    type: feedActionTypes.LOAD_FEEDS,
9
export const loadFeeds = () => ({
Línea 14... Línea 10...
14
  }
10
  type: feedActionTypes.LOAD_FEEDS,
15
}
-
 
16
 
11
})
17
export const loadFeedsSuccess = (feeds, currentPage, pages) => {
12
 
18
  return {
-
 
19
    type: feedActionTypes.LOAD_FEEDS_SUCCESS,
13
export const loadFeedsSuccess = (feeds, currentPage, pages) => ({
Línea 20... Línea 14...
20
    payload: { feeds, currentPage, pages },
14
  type: feedActionTypes.LOAD_FEEDS_SUCCESS,
21
  }
15
  payload: { feeds, currentPage, pages },
22
}
16
})
23
 
17
 
Línea 50... Línea 44...
50
          dispatch(loadFeedsSuccess(feeds, currentPage, pages))
44
          dispatch(loadFeedsSuccess(feeds, currentPage, pages))
51
        }
45
        }
52
      })
46
      })
53
      .catch((error) => {
47
      .catch((error) => {
54
        // dispatch(fetchFeedsFailure());
48
        // dispatch(fetchFeedsFailure());
-
 
49
        console.log(error)
55
        throw Error(error)
50
        throw new Error(error)
56
      })
51
      })
57
  }
52
  }
58
}
53
}