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

    Interface HookResult<T>

    Standard return shape for data-fetching hooks.

    const { data, loading, error }: HookResult<SoundCloudTrack> = useTrack(123);
    
    interface HookResult<T> {
        data: T | null;
        error: Error | null;
        loading: boolean;
    }

    Type Parameters

    • T

      The type of data returned on success.

    Index

    Properties

    Properties

    data: T | null

    Fetched data, or null while loading or on error.

    error: Error | null

    The error thrown during fetch, or null on success.

    loading: boolean

    true while the request is in flight.