poster.js
740 Bytes
import { GetPosterList, GetPosterInfo } from "../services/poster";
export default {
namespace: "poster",
state: {
// item: {},
},
effects: {
*getPosterList({ payload, callback }, { call, put }) {
const { data } = yield call(GetPosterList, payload);
callback && callback(data);
},
*getPosterInfo({ payload, callback, error }, { call, put }) {
const { data } = yield call(GetPosterInfo, payload);
if (data.status) {
callback && callback(data.data);
} else {
error && error(data);
}
}
},
reducers: {
// saveUser(state, { payload }) {
// console.log(payload);
// return { ...state, item: payload };
// },
},
subscriptions: {}
};