soundcloud-api-ts-next
    Preparing search index...

    Function useUserLikes

    • Fetch tracks liked by a SoundCloud user.

      Parameters

      • userId: string | number | undefined

        The user ID. Pass undefined to skip the request.

      Returns HookResult<SoundCloudTrack[]>

      Hook result with data as an array of liked SoundCloudTrack.

      import { useUserLikes } from "soundcloud-api-ts-next";

      function LikedTracks({ userId }: { userId: number }) {
      const { data: tracks, loading } = useUserLikes(userId);
      if (loading) return <p>Loading...</p>;
      return <ul>{tracks?.map(t => <li key={t.id}>{t.title}</li>)}</ul>;
      }