feat: remove loading from model and use DvaModel instead of redundant types such as kAModelType (#47)

* feat: use DvaModel instead of redundant types such as kAModelType

* feat: set the type for registerServer

* feat: remove loading from model
This commit is contained in:
balibabu
2024-01-30 19:26:29 +08:00
committed by GitHub
parent 96a1a44cb6
commit 362ec6c364
29 changed files with 1911 additions and 1938 deletions

View File

@ -1,15 +1,8 @@
import React from 'react';
import { connect, Dispatch } from 'umi';
import type { chatModelState } from './model'
import { useSelector } from 'umi';
interface chatProps {
chatModel: chatModelState;
dispatch: Dispatch
}
const View: React.FC<chatProps> = ({ chatModel, dispatch }) => {
const { name } = chatModel;
return <div>chat:{name} </div>;
const Chat = () => {
const { name } = useSelector((state: any) => state.chatModel);
return <div>chat:{name} </div>;
};
export default connect(({ chatModel, loading }) => ({ chatModel, loading }))(View);
export default Chat;