Xivgear Types Documentation
    Preparing search index...

    Class PromiseHelper<T>

    Helper for a design pattern where we have some value which is populated asynchronously, but we might update the value after receiving an initial value. For example, we use the account service to retrieve a JWT token. A consumer just wants a valid token - so they want to wait for the initial token retrieval, but they also don't want to be locked in to a stale token.

    When getting .promise, it will return either a promise that waits for the initial value, or immediately resolves to the most recently seen value.

    Type Parameters

    • T
    Index

    Constructors

    Accessors

    Methods

    Constructors

    Accessors

    • get promise(): Promise<T>

      Returns Promise<T>

    Methods

    • Parameters

      • value: T

      Returns void