Sha256: b9abbf9ea20d3b9353742d53782e8f6051a255785c3ea705d7eea40c6c3cd9a2

Contents?: true

Size: 542 Bytes

Versions: 45

Compression:

Stored size: 542 Bytes

Contents

"use strict";

var ensurePlainFunction = require("../../object/ensure-plain-function")
  , ensureThenable      = require("../../object/ensure-thenable")
  , microtaskDelay      = require("../../function/#/microtask-delay");

module.exports = function (callback) {
	ensureThenable(this);
	ensurePlainFunction(callback);
	// Rely on microtaskDelay to escape eventual error swallowing
	this.then(
		microtaskDelay.call(function (value) {
			callback(null, value);
		}),
		microtaskDelay.call(function (reason) {
			callback(reason);
		})
	);
};

Version data entries

45 entries across 45 versions & 2 rubygems

Version Path
govuk_publishing_components-18.0.0 node_modules/es5-ext/promise/#/as-callback.js
govuk_publishing_components-17.21.0 node_modules/es5-ext/promise/#/as-callback.js
govuk_publishing_components-17.20.0 node_modules/es5-ext/promise/#/as-callback.js
govuk_publishing_components-17.19.1 node_modules/es5-ext/promise/#/as-callback.js
govuk_publishing_components-17.19.0 node_modules/es5-ext/promise/#/as-callback.js
govuk_publishing_components-17.18.0 node_modules/es5-ext/promise/#/as-callback.js
govuk_publishing_components-17.17.0 node_modules/es5-ext/promise/#/as-callback.js
govuk_publishing_components-17.16.0 node_modules/es5-ext/promise/#/as-callback.js
govuk_publishing_components-17.15.0 node_modules/es5-ext/promise/#/as-callback.js
govuk_publishing_components-17.14.0 node_modules/es5-ext/promise/#/as-callback.js
govuk_publishing_components-17.13.0 node_modules/es5-ext/promise/#/as-callback.js
govuk_publishing_components-17.12.2 node_modules/es5-ext/promise/#/as-callback.js
govuk_publishing_components-17.12.1 node_modules/es5-ext/promise/#/as-callback.js
govuk_publishing_components-17.12.0 node_modules/es5-ext/promise/#/as-callback.js
govuk_publishing_components-17.11.0 node_modules/es5-ext/promise/#/as-callback.js
govuk_publishing_components-17.10.0 node_modules/es5-ext/promise/#/as-callback.js
govuk_publishing_components-17.9.0 node_modules/es5-ext/promise/#/as-callback.js
govuk_publishing_components-17.8.0 node_modules/es5-ext/promise/#/as-callback.js
govuk_publishing_components-17.7.0 node_modules/es5-ext/promise/#/as-callback.js
govuk_publishing_components-17.6.1 node_modules/es5-ext/promise/#/as-callback.js