Proyectos de Subversion LeadersLinked - Antes de SPA

Rev

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

Rev 5310 Rev 6359
Línea 2... Línea 2...
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) => {
4
export const setTimelineUrl = (url) => {
5
  return {
5
  return {
6
    type: feedActionTypes.SET_TIMELINE_URL,
6
    type: feedActionTypes.SET_TIMELINE_URL,
7
    payload: url
7
    payload: url,
8
  }
8
  }
Línea 9... Línea 9...
9
}
9
}
10
 
10
 
11
export const loadFeeds = () => {
11
export const loadFeeds = () => {
12
  return {
12
  return {
13
    type: feedActionTypes.LOAD_FEEDS
13
    type: feedActionTypes.LOAD_FEEDS,
Línea 14... Línea 14...
14
  }
14
  }
15
}
15
}
16
 
16
 
17
export const loadFeedsSuccess = (feeds, currentPage, pages) => {
17
export const loadFeedsSuccess = (feeds, currentPage, pages) => {
18
  return {
18
  return {
19
    type: feedActionTypes.LOAD_FEEDS_SUCCESS,
19
    type: feedActionTypes.LOAD_FEEDS_SUCCESS,
Línea 20... Línea 20...
20
    payload: { feeds, currentPage, pages }
20
    payload: { feeds, currentPage, pages },
21
  }
21
  }
22
}
22
}
23
 
23
 
Línea 24... Línea 24...
24
export const addFeed = (feed, feedSharedId = '') => ({
24
export const addFeed = (feed, feedSharedId = '') => ({
25
  type: feedActionTypes.ADD_FEED,
25
  type: feedActionTypes.ADD_FEED,
26
  payload: { feed, feedSharedId }
26
  payload: { feed, feedSharedId },
27
})
27
})
Línea 28... Línea 28...
28
 
28
 
29
export const deleteFeed = (feedId) => ({
29
export const deleteFeed = (feedId) => ({
30
  type: feedActionTypes.DELETE_FEED,
30
  type: feedActionTypes.DELETE_FEED,
31
  payload: feedId
31
  payload: feedId,
Línea 32... Línea 32...
32
})
32
})
33
 
33
 
34
export const setCurrentPage = (page) => ({
34
export const setCurrentPage = (page) => ({
Línea 50... Línea 50...
50
          dispatch(loadFeedsSuccess(feeds, currentPage, pages))
50
          dispatch(loadFeedsSuccess(feeds, currentPage, pages))
51
        }
51
        }
52
      })
52
      })
53
      .catch((error) => {
53
      .catch((error) => {
54
        // dispatch(fetchFeedsFailure());
54
        // dispatch(fetchFeedsFailure());
55
        throw Error(error.message)
55
        throw Error(error)
56
      })
56
      })
57
  }
57
  }
58
}
58
}