🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Book a DemoInstallSign in
Socket

extrinsic-promises

Package Overview
Dependencies
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

extrinsic-promises - npm Package Compare versions

Comparing version

to
1.1.0

CHANGES.yaml

3

package.json
{
"name": "extrinsic-promises",
"version": "1.0.0",
"version": "1.1.0",
"description": "A convenient promises anti-pattern: promises you can settle from outside the promise.",

@@ -18,2 +18,3 @@ "keywords": [

"check:lint:ci": "npm-run-all --parallel check:lint:ci:*",
"check:lint:changes": "yamllint CHANGES.yaml",
"check:lint:readme:markdown": "remark --no-stdout README.md",

@@ -20,0 +21,0 @@ "check:lint:readme": "npm-run-all --parallel check:lint:readme:*",

@@ -97,2 +97,11 @@ [![Build Status](https://travis-ci.org/mearns/extrinsic-promises.svg?branch=master)](https://travis-ci.org/mearns/extrinsic-promises)

This method is already bound and can be used correctly as a function reference. E.g.,:
```javascript
const exPromise = new ExtrinsicPromise()
const fulfillLater = exPromise.fulfill
// ...
fulfillLater(value) // correctly fulfills exPromise.
```
### `ExtrinsicPromise::reject([forReason])`

@@ -103,2 +112,22 @@

This method is already bound and can be used correctly as a function reference. E.g.,:
```javascript
const exPromise = new ExtrinsicPromise()
const rejectLater = exPromise.reject
// ...
rejectLater(reason) // correctly rejects exPromise.
```
### `ExtrinsicPromise::adopt(thennable)`
Adopt the state of the given thennable, once the thennable settles, if this extrinsic promise has not _already_
settled. This is a convenience for using this extrinsic promise's `fulfill` and `reject` methods as the on-fulfill
and on-reject handlers, respectively, of the given thennable, as follows:
```javascript
const exPromise = new ExtrinsicPromise()
thennable.then(exPromise.fulfill, exPromise.reject)
```
### `ExtrinsicPromise::work(workfunction)`

@@ -105,0 +134,0 @@