A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/es-shims/Promise.prototype.finally/tree/v1 below:

GitHub - es-shims/Promise.prototype.finally at v1

Promise.prototype.finally

A polyfill for Promise.prototype.finally. See docs on what finally is on your favourite pre-ES6 promise library.

Warning: This micro-library doesn't force you to use any particular Promise implementation by using whatever Promise has been defined as globally. This is so that you may use any ES6 standard Promise compliant library - or, of course, native ES6 Promises.

If you're running the code on a browser or node version that doesn't include native promises you will need to include a polyfill. The following polyfills are tested as part of this module's test suite:-

npm install promise.prototype.finally --save
require('es6-promise').polyfill();
require('promise.prototype.finally');

Promise.resolve(6)
	.finally(function() {
		console.log('this will always be called');
	});

Promise.reject(6)
	.finally(function() {
		console.log('this will always be called');
	});
Credits and collaboration

The lead developer of Promise.prototype.finally is Matt Andrews at FT, the code is based on a snippet by Stefan Penner - used with permission. All open source code released by FT Labs is licenced under the MIT licence. We welcome comments, feedback and suggestions. Please feel free to raise an issue or pull request.


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4