(login, nextPage)
| 69 | // Bails out if page is cached and user didn't specifically request next page. |
| 70 | // Relies on Redux Thunk middleware. |
| 71 | export const loadStarred = (login, nextPage) => (dispatch, getState) => { |
| 72 | const { |
| 73 | nextPageUrl = `users/${login}/starred`, |
| 74 | pageCount = 0 |
| 75 | } = getState().pagination.starredByUser[login] || {} |
| 76 | |
| 77 | if (pageCount > 0 && !nextPage) { |
| 78 | return null |
| 79 | } |
| 80 | |
| 81 | return dispatch(fetchStarred(login, nextPageUrl)) |
| 82 | } |
| 83 | |
| 84 | export const STARGAZERS_REQUEST = 'STARGAZERS_REQUEST' |
| 85 | export const STARGAZERS_SUCCESS = 'STARGAZERS_SUCCESS' |
no test coverage detected