Skip to content

Mock a tuple for async queue, like a Call Stack & Event Loop

Notifications You must be signed in to change notification settings

b0yblake/AsyncQueue

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ℹ️ Before submitting an issue to this repo - Ensure it's a issue with the code in this repo, you may meet some issue from rollup config - please take a look in this document Rollup and vite Vite

Why

Being a front-end engineer, especially deal with asynchronous coding, with some context special, queue loop stack in default browser not run like what you want. So I write this lib for difference mode: single parallel combine

  • Original event loop:

javascript event loop

  • With AsyncQueue mode single

  • With AsyncQueue mode parallel

  • With AsyncQueue mode combine

Running it on own's

  • Clone the project:
$ git clone https://github.com/b0yblake/AsyncQueue
  • Install:
$ cd csslayout
$ yarn

Usage

import { createAsyncQueue } from "asyncqueue-custom";
const queueProcess = createAsyncQueue();

// Some async function
function async doSomeThing() {}

// Push to list
await queueProcess.push(doSomeThing);

Explain

Contributing

PRs are welcomed. If you think there are any missing useful layouts or patterns, please create an issue or submit a PR.

If there is any issue, it will be logged in the tslint.log file.

About

This project is developed by Nguyen Huu Lich. I love building products and sharing knowledge.

Be my friend on