mirror of
https://github.com/terribleplan/next.js.git
synced 2024-01-19 02:48:18 +00:00
05b6891620
**Changes:** - Fixed "was character fetched on server" message by properly passing `isServer`. - Stop fetching if there was an error (currently it keeps sending requests to the same endpoint every 3 sec) **Related:** - https://github.com/zeit/next.js/pull/4818 - https://github.com/zeit/next.js/issues/4724
22 lines
608 B
JavaScript
22 lines
608 B
JavaScript
import * as types from './actionTypes'
|
|
|
|
export const startFetchingCharacters = () => ({
|
|
type: types.START_FETCHING_CHARACTERS
|
|
})
|
|
export const stopFetchingCharacters = () => ({
|
|
type: types.STOP_FETCHING_CHARACTERS
|
|
})
|
|
export const fetchCharacter = (isServer = false) => ({
|
|
type: types.FETCH_CHARACTER,
|
|
payload: { isServer }
|
|
})
|
|
export const fetchCharacterSuccess = (response, isServer) => ({
|
|
type: types.FETCH_CHARACTER_SUCCESS,
|
|
payload: { response, isServer }
|
|
})
|
|
|
|
export const fetchCharacterFailure = (error, isServer) => ({
|
|
type: types.FETCH_CHARACTER_FAILURE,
|
|
payload: { error, isServer }
|
|
})
|