同步异步action

export const fetchInitData = () => { 
    return (dispatch) => {
    $.get("/api/filters.json" , function(data){
        dispatch({"type" : "FETCHINITDATA" ,  data : data})
    });
}};
export const addfilter = (title,v) => {
    return {"type" : "ADDFILTER" , title , v}
}

猜你喜欢

转载自blog.csdn.net/qq_43137725/article/details/82564029