
#############
UnsafePromise
#############

.. js:class:: Util.UnsafePromise

   This represents a ``Promise`` that has its promised return value immediately available. The immediate value is unsafe to use (safety depends on specific use cases) until this ``UnsafePromise`` becomes marked as ready.
   
   The primary use case of this would be to synchronously return a reference to an object that needs to wait for an ``init(): Promise<void>`` function to complete.
   
   
   Index
   =====
   
   .. rubric:: Properties
   
   
   .. rst-class:: api-xref-list
   
   
   * :js:data:`~Util.UnsafePromise.isReady`
   * :js:data:`~Util.UnsafePromise.readyPromise`
   * :js:data:`~Util.UnsafePromise.unsafeValue`
   
   




Properties
==========

.. js:data:: Util.UnsafePromise.isReady

   .. rst-class:: sig-pretty-signature
   
      | isReady: *boolean*
   
   This value becomes ``true`` once ``this.readyPromise`` resolves. If ``this.readyPromise`` rejects, this value never becomes ``true``\ .
   



.. js:data:: Util.UnsafePromise.readyPromise

   .. rst-class:: sig-pretty-signature
   
      | readyPromise: *Promise*
   
   This promise resolves once ``this.unsafeValue`` is safe to access.
   



.. js:data:: Util.UnsafePromise.unsafeValue

   .. rst-class:: sig-pretty-signature
   
      | unsafeValue: T
   
   An unsafe synchronous reference to the value returned through this promise's ``then()`` callback.
   





