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

    Function useUserPlaylists

    • Fetch playlists created by a SoundCloud user.

      Parameters

      • userId: string | number | undefined

        The user ID. Pass undefined to skip the request.

      Returns HookResult<SoundCloudPlaylist[]>

      Hook result with data as an array of SoundCloudPlaylist.

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

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