Crypto Bot API
    Preparing search index...

    Function createFetchHandler

    • Create cached fetch handler for passed data type

      Store using for data types, which change infrequently. For example, app infomation from getMe method. For method calls more often than the passed update period, returned data from cache without real request to backend API

      Type Parameters

      • T

        One of library methods return data type

      Parameters

      • transport: Transport

        Transport class instance

      • method: ApiMethod

        Backend API method, data type related

      • castFn: (value: any) => T

        Convert backend API result to inner library method result type function

      • updatePeriod: number

        Updatin data from backend API period

      Returns (isForce?: boolean) => Promise<T>

      Update data type function

      Returned update data function receive isForce boolean parameter, if it true, for this method call function makes real request to backend API