/* * @Author: your name * @Date: 2021-12-22 09:36:53 * @LastEditTime: 2021-12-22 09:48:30 * @LastEditors: Please set LastEditors * @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE * @FilePath: /KC-MiddlePlatform/src/models/model.ts */ // import { Effect, Reducer, Subscription } from 'umi'; // export interface IndexModelState { // name: string; // } // export interface IndexModelType { // namespace: 'index'; // state: IndexModelState; // effects: { // query: Effect; // }; // reducers: { // save: Reducer; // // 启用 immer 之后 // // save: ImmerReducer; // }; // subscriptions: { setup: Subscription }; // } // const IndexModel: IndexModelType = { // namespace: 'index', // state: { // name: '', // }, // effects: { // *query({ payload }, { call, put }) {}, // }, // reducers: { // save(state, action) { // return { // ...state, // ...action.payload, // }; // }, // // 启用 immer 之后 // // save(state, action) { // // state.name = action.payload; // // }, // }, // subscriptions: { // setup({ dispatch, history }) { // return history.listen(({ pathname }) => { // if (pathname === '/') { // dispatch({ // type: 'query', // }); // } // }); // }, // }, // }; // export default IndexModel;