so1ve / crpr

Create a promise, but avoid using constructors.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

crpr

NPM version

Create a promise, but avoid using constructors.

📦 Installation

$ npm install crpr
$ yarn add crpr
$ pnpm add crpr

🚀 Usage

import { crpr } from "crpr";

const { promise, resolve, reject } = crpr<string>();
// or const [promise, resolve, reject] = crpr<string>();

resolve("114514");

promise.then(console.log); // 114514

📝 License

MIT. Made with ❤️ by Ray

About

Create a promise, but avoid using constructors.

License:MIT License


Languages

Language:TypeScript 100.0%