Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@creately/future

Package Overview
Dependencies
Maintainers
5
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@creately/future - npm Package Compare versions

Comparing version 1.0.2 to 2.0.0

4

changelog.md

@@ -0,3 +1,7 @@

## v2.0.0
- Export `Future` as a type and export a `createFuture` factory function.
## v1.0.2
- Export `Future` class with `resolve` and `reject` methods.

10

dist/index.d.ts
/**
* Future
* Future extends Promise and exposes the resolve and reject methods.
*/
export declare class Future<T> extends Promise<T> {
export declare type Future<T> = Promise<T> & {
resolve: (val: T) => void;
reject: (err: Error) => void;
constructor();
}
};
/**
* Creates a new Future instance by extending a new Promise instance.
*/
export declare function createFuture<T>(): Future<T>;
"use strict";
var __extends = (this && this.__extends) || (function () {
var extendStatics = function (d, b) {
extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
return extendStatics(d, b);
}
return function (d, b) {
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
Object.defineProperty(exports, "__esModule", { value: true });
/**
* Future
* Future extends Promise and exposes the resolve and reject methods.
* Creates a new Future instance by extending a new Promise instance.
*/
var Future = /** @class */ (function (_super) {
__extends(Future, _super);
function Future() {
var _this = _super.call(this, function (resolve, reject) {
_this.resolve = resolve;
_this.reject = reject;
}) || this;
return _this;
}
return Future;
}(Promise));
exports.Future = Future;
function createFuture() {
var res;
var rej;
var future = new Promise(function (_res, _rej) {
res = _res;
rej = _rej;
});
Object.defineProperties(future, {
resolve: { value: res },
reject: { value: rej },
});
return future;
}
exports.createFuture = createFuture;
//# sourceMappingURL=index.js.map
{
"name": "@creately/future",
"version": "1.0.2",
"version": "2.0.0",
"description": "",

@@ -5,0 +5,0 @@ "main": "dist/index.js",

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc