0.1.2 • Published 9 months ago

@myty/stage3 v0.1.2

Weekly downloads
-
License
MIT
Repository
github
Last release
9 months ago

Stage3

GitHub version deno land npm version Coverage Status

Polyfill for TC39 Stage 3 proposals

https://github.com/tc39/proposals#stage-3

Installation

Node.js

# npm
npm install --save @myty/stage3
# yarn
yarn add @myty/stage3
# pnpm
pnpm install --save @myty/stage3

Deno

import "https://deno.land/x/stage3/mod.ts";
import "https://deno.land/x/stage3/promise-with-resolvers.ts";

Usage

import "@myty/stage3/script/promise-with-resolvers"; // Node.js (commonjs)
import "@myty/stage3/esm/promise-with-resolvers"; // Node.js (module)
import "https://deno.land/x/stage3/promise-with-resolvers.ts"; // Deno

// Arrange
const resolvedValue = 5;
const { resolve, promise } = Promise.withResolvers<number>();

// Act
setTimeout(() => resolve(resolvedValue), 10);
const result = await promise;

// Assert
assertEquals(result, resolvedValue);
0.1.2

9 months ago

0.1.1

9 months ago

0.1.0

9 months ago