New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

wing-sequence

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

wing-sequence

JavaScript sequence

latest
Source
npmnpm
Version
0.0.2
Version published
Maintainers
1
Created
Source

wing-sequence

JavaScript Sequence

Uage

import Sequence, { type PromiseHandler } from 'wing-sequence';

const sequence = new Sequence<PromiseHandler<boolean>>();
const log = (value: string) => sequence.push((v: boolean) => new Promise(async (r) => r(v && (await logAsync(value)))));
const logAsync = (value: string): Promise<boolean> => {
  return new Promise((resolve) => {
    setTimeout(() => {
      console.log(value);
      resolve(true);
    }, Math.random() * 100);
  });
};

function test() {
  setTimeout(() => {
    log('3');
  }, 200);

  log('1');

  log('2');
}


test();
// 1
// 2
// 3

Keywords

sequence

FAQs

Package last updated on 20 May 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts