mirror of
https://github.com/infiniflow/ragflow.git
synced 2025-12-05 11:27:39 +00:00
* feat: use DvaModel instead of redundant types such as kAModelType * feat: set the type for registerServer * feat: remove loading from model
33 lines
573 B
TypeScript
33 lines
573 B
TypeScript
import { DvaModel } from 'umi';
|
|
|
|
export interface ChatModelState {
|
|
name: string;
|
|
}
|
|
|
|
const model: DvaModel<ChatModelState> = {
|
|
namespace: 'chatModel',
|
|
state: {
|
|
name: 'kate',
|
|
},
|
|
reducers: {
|
|
save(state, action) {
|
|
return {
|
|
...state,
|
|
...action.payload,
|
|
};
|
|
},
|
|
},
|
|
subscriptions: {
|
|
setup({ dispatch, history }) {
|
|
return history.listen((query) => {
|
|
console.log(query);
|
|
});
|
|
},
|
|
},
|
|
effects: {
|
|
*query({ payload }, { call, put }) {},
|
|
},
|
|
};
|
|
|
|
export default model;
|