Please note, this is a STATIC archive of website developer.mozilla.org from 03 Nov 2016, cach3.com does not collect or store any user information, there is no "phishing" involved.

Revision 447553 of PromiseResolver

  • Revision slug: Web/API/PromiseResolver
  • Revision title: PromiseResolver
  • Revision id: 447553
  • Created:
  • Creator: teoli
  • Is current revision? No
  • Comment

Revision Content

{{DOMRef()}}{{SeeCompatTable}}

The PromiseResolver interface represents an object controlling the state and the result value of a {{domxref("Promise")}}

Properties

No specific property.

Methods

Doesn't inherit any method.

{{domxref("PromiseResolver.fulfill()")}}
Sets the result value of the associated Promise to the parameter and its state to fulfill. Call the fulfill callbacks or, if the asynch parameter is set to true, queue a task to call them.
{{domxref("PromiseResolver.resolve()")}}
...
{{domxref("PromiseResolver.reject()")}}
Sets the result value of the associated Promise to the parameter and its state to rejected. Call the reject callbacks or if the asynch parameter is set to true, queue a task to call them.

Specification

Specification Status Comment
{{SpecName('DOM WHATWG', '#promiseresolver', 'PromiseResolver')}} {{Spec2('DOM WHATWG')}} Initial definition

Browser compatibility

{{CompatibilityTable}}

Feature Chrome Firefox (Gecko) Internet Explorer Opera Safari
Basic support {{CompatNo}} {{CompatGeckoDesktop(24)}} as FutureResolver
{{CompatGeckoDesktop(25)}} as PromiseResolver [1]
{{CompatNo}} {{CompatNo}} {{CompatNo}}
Feature Android Firefox Mobile (Gecko) IE Mobile Opera Mobile Safari Mobile
Basic support {{CompatNo}} {{CompatGeckoMobile(24)}} as FutureResolver
{{CompatGeckoMobile(25)}} as PromiseResolver [1]
{{CompatNo}} {{CompatNo}} {{CompatNo}}

[1] Gecko 24 has an experimental implementation of PromiseResolver, under the initial name of FutureResolver. It got renamed to its final name in Gecko 25. To disabled, the preference dom.promise.enabled (in Gecko 24, dom.future.enabled) must be switched to false. Note that it is enabled by default except on B2G builds.

See also

Revision Source

<p>{{DOMRef()}}{{SeeCompatTable}}</p>
<p>The <code><strong>PromiseResolver</strong></code> interface represents an object controlling the state and the result value of a {{domxref("Promise")}}</p>
<h2 id="Properties">Properties</h2>
<p><em>No specific property.</em></p>
<h2 id="Methods">Methods</h2>
<p><em>Doesn't inherit any method.</em></p>
<dl>
  <dt>
    {{domxref("PromiseResolver.fulfill()")}}</dt>
  <dd>
    Sets the result value of the associated <code>Promise</code> to the parameter and its state to <code>fulfill</code>. Call the fulfill callbacks or, if the <em>asynch</em> parameter is set to <code>true</code>, queue a task to call them.</dd>
  <dt>
    {{domxref("PromiseResolver.resolve()")}}</dt>
  <dd>
    ...</dd>
  <dt>
    {{domxref("PromiseResolver.reject()")}}</dt>
  <dd>
    Sets the result value of the associated <code>Promise</code> to the parameter and its state to <code>rejected</code>. Call the reject callbacks or if the <em>asynch</em> parameter is set to <code>true</code>, queue a task to call them.</dd>
</dl>
<h2 id="Specification">Specification</h2>
<table class="standard-table">
  <tbody>
    <tr>
      <th scope="col">Specification</th>
      <th scope="col">Status</th>
      <th scope="col">Comment</th>
    </tr>
    <tr>
      <td>{{SpecName('DOM WHATWG', '#promiseresolver', 'PromiseResolver')}}</td>
      <td>{{Spec2('DOM WHATWG')}}</td>
      <td>Initial definition</td>
    </tr>
  </tbody>
</table>
<h2 id="Browser_compatibility">Browser compatibility</h2>
<p>{{CompatibilityTable}}</p>
<div id="compat-desktop">
  <table class="compat-table">
    <tbody>
      <tr>
        <th>Feature</th>
        <th>Chrome</th>
        <th>Firefox (Gecko)</th>
        <th>Internet Explorer</th>
        <th>Opera</th>
        <th>Safari</th>
      </tr>
      <tr>
        <td>Basic support</td>
        <td>{{CompatNo}}</td>
        <td>{{CompatGeckoDesktop(24)}} as <code>FutureResolver</code><br />
          {{CompatGeckoDesktop(25)}} as <code>PromiseResolver </code>[1]</td>
        <td>{{CompatNo}}</td>
        <td>{{CompatNo}}</td>
        <td>{{CompatNo}}</td>
      </tr>
    </tbody>
  </table>
</div>
<div id="compat-mobile">
  <table class="compat-table">
    <tbody>
      <tr>
        <th>Feature</th>
        <th>Android</th>
        <th>Firefox Mobile (Gecko)</th>
        <th>IE Mobile</th>
        <th>Opera Mobile</th>
        <th>Safari Mobile</th>
      </tr>
      <tr>
        <td>Basic support</td>
        <td>{{CompatNo}}</td>
        <td>{{CompatGeckoMobile(24)}} as <code>FutureResolver</code><br />
          {{CompatGeckoMobile(25)}} as <code>PromiseResolver</code> [1]</td>
        <td>{{CompatNo}}</td>
        <td>{{CompatNo}}</td>
        <td>{{CompatNo}}</td>
      </tr>
    </tbody>
  </table>
</div>
<p>[1] Gecko 24 has an experimental implementation of <code>PromiseResolver</code>, under the initial name of <code>FutureResolver</code>. It got renamed to its final name in Gecko 25. To disabled, the preference <code>dom.promise.enabled</code> (in Gecko 24, <code>dom.future.enabled</code>) must be switched to <code>false</code>. Note that it is enabled by default except on B2G builds.</p>
<h2 id="See_also">See also</h2>
<ul>
  <li><a href="/en-US/docs/Web/API/Guide/Using_DOM_Promises" title="/en-US/docs/Web/API/Guide/Using_DOM_Promises">Using DOM promises</a></li>
  <li>Related DOM interfaces: {{domxref("Promise")}}</li>
</ul>
Revert to this revision