An object with follow, unfollow, loading, and error.
import { useFollow } from "soundcloud-api-ts-next";
function FollowButton({ userId }: { userId: number }) {
const { follow, unfollow, loading } = useFollow();
return (
<button onClick={() => follow(userId)} disabled={loading}>
Follow
</button>
);
}
Follow or unfollow a SoundCloud user. Requires authentication.