/crpr

Create a promise, but avoid using constructors.

Primary LanguageTypeScriptMIT LicenseMIT

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