const [list, setList] = useState([]);
class Person {
async handleList(data: () => any, record: any) {
await data().then((res: any) => {
record(res.data);
});
}
}
const person = new Person();
useEffect(() => {
person.handleList(getSwiper, setList);
}, []);