# @pedromsilva/data-future

> Simple TypeScript/ES2015 class to allow to create a promise and to be resolved/rejected later

Latest version **1.1.3** (published 2019-06-25) · ISC license · 0 weekly downloads

## Install

```sh
npm install @pedromsilva/data-future
pnpm add @pedromsilva/data-future
yarn add @pedromsilva/data-future
bun add @pedromsilva/data-future
```

## Health

**Score 25/100 (F)** — status: abandoned.

Positive: has types; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.1.3 |
| Published | 2019-06-25 |
| First published | 2018-04-19 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Pedro M. Silva |
| Maintainers | pedromsilva |
| Keywords | js, future, deferred, async, promises |

## Links

- npm: https://www.npmjs.com/package/@pedromsilva/data-future
- Repository: https://github.com/pedromsilvapt/data-future
- Homepage: https://github.com/pedromsilvapt/data-future#readme
- Issues: https://github.com/pedromsilvapt/data-future/issues
- npm.io page: https://npm.io/package/@pedromsilva/data-future

## Alternatives

- [@mapbox/jsonlint-lines-primitives](https://npm.io/package/@mapbox/jsonlint-lines-primitives.md) — 5.3M weekly downloads
- [reftools](https://npm.io/package/reftools.md) — 3.5M weekly downloads
- [@hey-api/openapi-ts](https://npm.io/package/@hey-api/openapi-ts.md) — 3.5M weekly downloads
- [@mapbox/geojson-rewind](https://npm.io/package/@mapbox/geojson-rewind.md) — 2.4M weekly downloads
- [turbo-stream](https://npm.io/package/turbo-stream.md) — 1.7M weekly downloads

## Recent versions

- 1.1.3 (latest) — 2019-06-25
- 1.1.2 — 2018-06-02
- 1.1.1 — 2018-06-01
- 1.1.0 — 2018-06-01
- 1.0.0 — 2018-04-19

## README

# Future

> Simple TypeScript/ES2015 class to allow to create a promise and to be resolved/rejected later

# Installation
```shell
npm install --save data-future
```

# Usage
```typescript
import { Future } from 'data-future';

const future = new Future<number>();

futrue.promise.then( number => console.log( number ) ); // 1

// Can be called anytime after instantiating a Future object
future.resolve( 1 );
```

```typescript
import { Future } from 'data-future';

const future = new Future<number>();

futrue.promise.catch( err => console.error( err ) ); // Error {}

// Can be called anytime after instantiating a Future object
future.reject( new Error() );
```

---
_Source: https://npm.io/package/@pedromsilva/data-future · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
