App/Reducers/HomeReducer.js

(完整代码) 969B



import * as types from '../Action/ActionType';

const initialState = {
    HomeList: [],
    UGOList:[], 
    isLoading: true,
    isRefreshing: false,
};

let homeReducer = (state = initialState, action) => {

    switch (action.type) {
        case types.FETCH_HOME_LIST, types.FETCH_SEAUGO_LIST:
            return Object.assign({}, state, {
                isRefreshing: action.isRefreshing,
                isLoading: action.isLoading
            })

        case types.RECEIVE_HOME_LIST:


            return Object.assign({}, state, {
                HomeList: action.homeList,
                isRefreshing: false,
                isLoading: false,
            })
        case types.RECEIVE_SEAUGO_LIST:


            return Object.assign({}, state, {
                UGOList: action.uGoList,
                isRefreshing: false,
                isLoading: false,
            })

        default:
            return state;
    }
}

export default homeReducer;

24 小时内免费解锁 3 个项目,之后 1 积分/个。 规则说明

AI 解读

登录后可用,每次 10 积分,解读结果公开显示在下面。

还没有人解读过这个文件。