You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
19 lines
546 B
19 lines
546 B
/**
|
|
* 企业端人才推荐数据 hook。
|
|
*/
|
|
import { useCallback } from 'react';
|
|
import { fetchTalentRecommendation } from '../api';
|
|
import type { TalentRecommendation } from '../types';
|
|
import { useAsyncData } from './useAsyncData';
|
|
|
|
export function useTalentRecommendation() {
|
|
const fetcher = useCallback(async (): Promise<TalentRecommendation> => fetchTalentRecommendation(), []);
|
|
const { data, loading, error, refresh } = useAsyncData(fetcher);
|
|
|
|
return {
|
|
recommendation: data ?? null,
|
|
loading,
|
|
error,
|
|
refresh,
|
|
};
|
|
}
|
|
|