Pebble App Framework: Phone API
    Preparing search index...

    Function pickProvider

    • Finds the provider a face saved, or the fallback when the name is not one of the table's own.

      Only the table's own keys count. A saved constructor would otherwise pull a built-in off the object's prototype and crash calling .fetch on it.

      Type Parameters

      • P

      Parameters

      • providers: Record<string, P>

        The provider modules by lowercase name.

      • name: unknown

        The provider name from settings, in any case, or nothing when none is saved yet.

      • fallback: string

        The table key to use when the name matches nothing.

      • kind: string

        What kind of provider this is, for the log.

      Returns P

      The provider to call.