npm.io
0.3.0 • Published 2 weeks ago

@ledgerhq/live-promise

Licence
Apache-2.0
Version
0.3.0
Deps
1
Size
32 kB
Vulns
0
Weekly
0
Stars
606

live-promise

@ledgerhq/live-promise provides small, focused Promise utilities for Ledger Live. Rather than pulling in a heavy async library, it ships only the primitives the codebase actually needs: retrying, delaying, and composing async operations.

What it does

  • retry(fn, options) — retries an async function with configurable exponential back-off, max attempts, and a custom retry-condition predicate.
  • delay(ms) — returns a Promise that resolves after ms milliseconds.

Key exports / concepts

  • retry<A>(f: () => Promise<A>, options?)maxRetry, interval, intervalMultiplicator, retryCondition.
  • delay(ms: number): Promise<void>.

Usage context

Used throughout libs/ledger-live-common and coin modules wherever network calls or device commands need automatic retry logic. Zero runtime dependencies beyond the standard Promise API.

Keywords