import React, { useEffect, useMemo, useRef, useState } from 'react';
import { useModel, useRequest } from '@umijs/max';
import { queryUserList } from '@/Project/services/project';

export default () => {
  const [curProjectId, setCurProjectId] = useState(0);
  const { data: userList, loading: loading, run: run } = useRequest(queryUserList, { manual: true });
  useEffect(() => {
    if (curProjectId) {
      run(curProjectId)
    }
  }, [curProjectId]);
  return { userList, loading, setCurProjectId }
}