import { combineReducers } from 'redux';
import {ADD_TO_CART,CHECKOUT_CART,INITIALIZATION} from '../actions/action.jsx';
import { List, Map , toJS } from 'immutable';
const products = List([]);
const initializateReducer = (state=products ,action) =>{
if(!action.products){
return state;
}
switch(action.type){
case INITIALIZATION :
for(let i=0; i< action.products.length;i++){
state.push(Map(action.products[i])); //push不进去????!!!
}
return state;
default:
return state;
}
};
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号
Immutable data cannot be changed once created.
去看看文档吧http://facebook.github.io/imm...
const-->letconst initializateReducer = (state={} ,action) =>{
};