Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- export function useGetAllArtists() {
- const [artist, setArtists] = useState([]);
- useEffect(() => {
- (async () => {
- try {
- const result = await artistAPI.getAll();
- setArtists(result);
- } catch (err) {
- console.error('Error fetching artists:', err);
- throw err;
- }
- })();
- }, []);
- return artist;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement