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 891673 of PromiseResolver

  • Revision slug: Web/API/PromiseResolver
  • Revision title: PromiseResolver
  • Revision id: 891673
  • Created:
  • Creator: Sebastianz
  • Is current revision? Yes
  • Comment Removed redundant browser-specific note from compatibility table and fixed page formatting to allow the compat data scraper to parse the page

Revision Content

{{ApiRef("DOM")}}{{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)}}[1] {{CompatNo}} {{CompatNo}} {{CompatNo}}
Feature Android Firefox Mobile (Gecko) IE Mobile Opera Mobile Safari Mobile
Basic support {{CompatNo}} {{CompatGeckoMobile(24)}}[1] {{CompatNo}} {{CompatNo}} {{CompatNo}}

[1] Nightly of Gecko 24 got an experimental implementation of PromiseResolver, under the initial name of FutureResolver. It got renamed to its final name in the Gecko 25. To disable it, the preference dom.promise.enabled (in Gecko 24, dom.future.enabled) must be switched to false. Note, only Nightly and Dev Edition versions of Firefox get this interface enabled by default. Beta and Release versions of Gecko have them disabled by default.

See also

Revision Source

<div>{{ApiRef("DOM")}}{{SeeCompatTable}}</div>

<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)}}<sup>[1]</sup></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)}}<sup>[1]</sup></td>
   <td>{{CompatNo}}</td>
   <td>{{CompatNo}}</td>
   <td>{{CompatNo}}</td>
  </tr>
 </tbody>
</table>
</div>

<p>[1] Nightly of Gecko 24 got an experimental implementation of <code>PromiseResolver</code>, under the initial name of <code>FutureResolver</code>. It got renamed to its final name in the Gecko 25. To disable it, the preference <code>dom.promise.enabled</code> (in Gecko 24, <code>dom.future.enabled</code>) must be switched to <code>false</code>. Note, only Nightly and Dev Edition versions of Firefox get this interface enabled by default. Beta and Release versions of Gecko have them disabled by default.</p>

<h2 id="See_also">See also</h2>

<ul>
 <li><a href="/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