Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. import { Effect, Reducer, Subscription } from 'umi';
  2. export interface chatModelState {
  3. name: string;
  4. }
  5. export interface chatModelType {
  6. namespace: 'chatModel';
  7. state: chatModelState;
  8. effects: {
  9. query: Effect;
  10. };
  11. reducers: {
  12. save: Reducer<chatModelState>;
  13. };
  14. subscriptions: { setup: Subscription };
  15. }
  16. const Model: chatModelType = {
  17. namespace: 'chatModel',
  18. state: {
  19. name: 'kate',
  20. },
  21. effects: {
  22. *query({ payload }, { call, put }) { },
  23. },
  24. reducers: {
  25. save(state, action) {
  26. return {
  27. ...state,
  28. ...action.payload,
  29. };
  30. },
  31. },
  32. subscriptions: {
  33. setup({ dispatch, history }) {
  34. return history.listen((query) => {
  35. console.log(query)
  36. });
  37. },
  38. },
  39. };
  40. export default Model;