extrinsic-promises
Advanced tools
Comparing version 1.1.0 to 1.2.0
@@ -110,2 +110,20 @@ "use strict"; | ||
/** | ||
* Have this extrinsic promise adopt the state of the specified thennable. If the given thennable | ||
* fulfills, this extrinsic promise will fulfill with the same value. If the given thennable rejects, | ||
* this extrinsic promise will reject for the same reason. While the given thennable is unsettled, | ||
* this extrinsic promise will remain unsettled. | ||
* | ||
* If this extrinsic promise is already settled, it will not change. | ||
* | ||
* Return back this same object for convenience. | ||
*/ | ||
}, { | ||
key: "adopt", | ||
value: function adopt(promise) { | ||
promise.then(this.fulfill, this.reject); | ||
return this; | ||
} | ||
/** | ||
* Returns a thennable which is bound to this extrinsic promise through | ||
@@ -134,2 +152,2 @@ * the closure, but only exposes a `then` method, thereby hiding all other | ||
exports.default = ExtrinsicPromise; | ||
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9pbmRleC5qcyJdLCJuYW1lcyI6WyJidWlsdGluUHJvbWlzZUZhY3RvcnkiLCJ3ZiIsIlByb21pc2UiLCJFeHRyaW5zaWNQcm9taXNlIiwicHJvbWlzZUZhY3RvcnkiLCJmdWxmaWxsZWRXaXRoIiwicmVqZWN0ZWRGb3IiLCJmdWxmaWxsZWQiLCJyZWplY3RlZCIsImZ1bGZpbGwiLCJ3aXRoVmFsdWUiLCJyZWplY3QiLCJmb3JSZWFzb24iLCJwcm9taXNlIiwidGhlbiIsImJpbmQiLCJ3b3JrRnVuY3Rpb24iLCJzZXRJbW1lZGlhdGUiLCJlcnJvciJdLCJtYXBwaW5ncyI6Ijs7Ozs7Ozs7Ozs7Ozs7Ozs7O0FBQUE7Ozs7Ozs7O0FBUUEsSUFBTUEsd0JBQXdCLFNBQXhCQSxxQkFBd0IsQ0FBQ0MsRUFBRDtBQUFBLFNBQVEsSUFBSUMsT0FBSixDQUFZRCxFQUFaLENBQVI7QUFBQSxDQUE5Qjs7QUFFQTs7Ozs7OztJQU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UgdGhlIGdpdmVuIHRoZW5uYWJsZSBpcyB1bnNldHRsZWQsXG4gICAqIHRoaXMgZXh0cmluc2ljIHByb21pc2Ugd2lsbCByZW1haW4gdW5zZXR0bGVkLlxuICAgKlxuICAgKiBJZiB0aGlzIGV4dHJpbnNpYyBwcm9taXNlIGlzIGFscmVhZHkgc2V0dGxlZCwgaXQgd2lsbCBub3QgY2hhbmdlLlxuICAgKlxuICAgKiBSZXR1cm4gYmFjayB0aGlzIHNhbWUgb2JqZWN0IGZvciBjb252ZW5pZW5jZS5cbiAgICovXG4gIGFkb3B0IChwcm9taXNlKSB7XG4gICAgcHJvbWlzZS50aGVuKHRoaXMuZnVsZmlsbCwgdGhpcy5yZWplY3QpXG4gICAgcmV0dXJuIHRoaXNcbiAgfVxuXG4gIC8qKlxuICAgKiBSZXR1cm5zIGEgdGhlbm5hYmxlIHdoaWNoIGlzIGJvdW5kIHRvIHRoaXMgZXh0cmluc2ljIHByb21pc2UgdGhyb3VnaFxuICAgKiB0aGUgY2xvc3VyZSwgYnV0IG9ubHkgZXhwb3NlcyBhIGB0aGVuYCBtZXRob2QsIHRoZXJlYnkgaGlkaW5nIGFsbCBvdGhlclxuICAgKiBtZXRob2RzIG9mIHRoZSB0aGlzIGV4dHJuaXNpYyBwcm9taXNlIChpLmUuLCBwcmV2ZW50aW5nIGNvZGUgd2hpY2ggb25seVxuICAgKiBoYXMgdGhlIHJldHVybmVkIG9iamVjdCBmcm9tIHNldHRsaW5nIHlvdXIgcHJvbWlzZSkuXG4gICAqL1xuICBoaWRlICgpIHtcbiAgICByZXR1cm4ge1xuICAgICAgdGhlbjogKC4uLmFyZ3MpID0+IHRoaXMudGhlbiguLi5hcmdzKVxuICAgIH1cbiAgfVxufVxuIl19 |
@@ -62,2 +62,15 @@ 'use strict'; | ||
it('should have fulfill as a bound method', function () { | ||
// given | ||
var testFulfill = 'test-value'; | ||
var promiseUnderTest = new _index2.default(); | ||
var fulfill = promiseUnderTest.fulfill; | ||
// when | ||
fulfill(testFulfill); | ||
// then | ||
return (0, _chai.expect)(promiseUnderTest).to.eventually.equal(testFulfill); | ||
}); | ||
it('should fulfill even if .reject() is called after .fulfill()', function () { | ||
@@ -117,8 +130,21 @@ // given | ||
it('should reject even if .reject() is called after .fulfill()', function () { | ||
it('should have reject as a bound method', function () { | ||
// given | ||
var testReason = new Error('Test Reason'); | ||
var promiseUnderTest = new _index2.default(); | ||
var reject = promiseUnderTest.reject; | ||
// when | ||
reject(testReason); | ||
// then | ||
return (0, _chai.expect)(promiseUnderTest).to.be.rejectedWith(testReason); | ||
}); | ||
it('should reject even if .fulfill() is called after .reject()', function () { | ||
// given | ||
var testReason = new Error('Test Reason'); | ||
var promiseUnderTest = new _index2.default(); | ||
// when | ||
promiseUnderTest.reject(testReason); | ||
@@ -218,2 +244,61 @@ promiseUnderTest.fulfill('some value'); | ||
describe('adopt() method', function () { | ||
it('should fulfill with the same value when the adopted promise fulfills', function () { | ||
// given | ||
var testFulfill = 'test-value'; | ||
var promiseUnderTest = new _index2.default(); | ||
var adoptedPromise = Promise.resolve(testFulfill); | ||
// when | ||
promiseUnderTest.adopt(adoptedPromise); | ||
// then | ||
return (0, _chai.expect)(promiseUnderTest).to.eventually.equal(testFulfill); | ||
}); | ||
it('should remain fulfilled with the same value if it was already fulfilled when the adopted promise is adopted', function () { | ||
// given | ||
var testFulfill = 'test-value'; | ||
var anotherFulfill = 'another-value'; | ||
var promiseUnderTest = new _index2.default(); | ||
var adoptedPromise = Promise.resolve(anotherFulfill); | ||
// when | ||
promiseUnderTest.fulfill(testFulfill); | ||
promiseUnderTest.adopt(adoptedPromise); | ||
// then | ||
return (0, _chai.expect)(promiseUnderTest).to.eventually.equal(testFulfill); | ||
}); | ||
it('should remain fulfilled with the same value if it was fulfilled after a promise is adopted but before it fulfills', function () { | ||
// given | ||
var testFulfill = 'test-value'; | ||
var anotherFulfill = 'another-value'; | ||
var promiseUnderTest = new _index2.default(); | ||
var adoptedPromise = new _index2.default(); | ||
// when | ||
promiseUnderTest.adopt(adoptedPromise); | ||
promiseUnderTest.fulfill(testFulfill); | ||
adoptedPromise.fulfill(anotherFulfill); | ||
// then | ||
return (0, _chai.expect)(promiseUnderTest).to.eventually.equal(testFulfill); | ||
}); | ||
it('should reject with the same reason when the adopted promise rejects', function () { | ||
// given | ||
var testReason = new Error('Test Reason'); | ||
var promiseUnderTest = new _index2.default(); | ||
var adoptedPromise = Promise.reject(testReason); | ||
// when | ||
promiseUnderTest.adopt(adoptedPromise); | ||
// then | ||
return (0, _chai.expect)(promiseUnderTest).to.be.rejectedWith(testReason); | ||
}); | ||
}); | ||
describe('work() method', function () { | ||
@@ -482,2 +567,2 @@ it('should call the provided work function and fulfilled when the first arg is invoked', function () { | ||
}(SynchronousPromise); | ||
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3Rlc3Qvc3JjL2luZGV4LnNwZWMuanMiXSwibmFtZXMiOlsidXNlIiwiZGVzY3JpYmUiLCJpdCIsInRlc3RGdWxmaWxsIiwicHJvbWlzZVVuZGVyVGVzdCIsImZ1bGZpbGwiLCJ0byIsImV2ZW50dWFsbHkiLCJlcXVhbCIsInJlamVjdCIsIkVycm9yIiwiUHJvbWlzZSIsInJlc29sdmUiLCJzZXRUaW1lb3V0IiwidGhlbiIsInRlc3RSZWFzb24iLCJiZSIsInJlamVjdGVkV2l0aCIsIlN5bmNocm9ub3VzUHJvbWlzZSIsIndmIiwiaGlkZGVuIiwiaGlkZSIsImZ1bGZpbGxWYWx1ZSIsIndvcmtTcHkiLCJzcHkiLCJ3b3JrIiwiaGF2ZSIsImJlZW4iLCJjYWxsZWRPbmNlIiwiTGF0ZXJQcm9taXNlIiwid29ya2Z1bmN0aW9uIiwic3RhdGUiLCJvbkZ1bGZpbGwiLCJvblJlamVjdCIsIndpdGhWYWx1ZSIsImZ1bGZpbGxlZFdpdGgiLCJmb3JFYWNoIiwiaGFuZGxlI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HtcbiAgICAgICAgd29ya2Z1bmN0aW9uKGZ1bGZpbGwsIHJlamVjdClcbiAgICAgIH0gY2F0Y2ggKGVycm9yKSB7XG4gICAgICAgIHJlamVjdChlcnJvcilcbiAgICAgIH1cbiAgICB9LCAxMClcbiAgfVxufVxuIl19 |
{ | ||
"name": "extrinsic-promises", | ||
"version": "1.1.0", | ||
"version": "1.2.0", | ||
"description": "A convenient promises anti-pattern: promises you can settle from outside the promise.", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
79308
635