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

    Function usePlaylist

    • Fetch a single SoundCloud playlist by ID.

      Parameters

      • playlistId: string | number | undefined

        The playlist ID. Pass undefined to skip the request.

      Returns HookResult<SoundCloudPlaylist>

      Hook result with data as a SoundCloudPlaylist.

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

      function PlaylistInfo({ id }: { id: number }) {
      const { data: playlist, loading } = usePlaylist(id);
      if (loading) return <p>Loading...</p>;
      return <h1>{playlist?.title}</h1>;
      }