Skip to content

Commit

Permalink
Remove unused stuff + fix minor docs error
Browse files Browse the repository at this point in the history
+ increment minor version
  • Loading branch information
Arrow7000 committed Aug 25, 2020
1 parent 206e8c0 commit 21e9520
Show file tree
Hide file tree
Showing 6 changed files with 53 additions and 2,526 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ A tiny library for queuing and throttling asynchronous functions.

Perfect for managing resource-intensive processes and controlling access to rate-limited APIs.

This project has 0 (zero) dependencies 👌.
This project has 0 (zero) runtime dependencies 👌.

![NPM stats](https://nodei.co/npm/qew.png?downloads=true&downloadRank=true&stars=true)

Expand Down Expand Up @@ -81,7 +81,7 @@ prom
// `push`'s result can also be `await`ed in an async function like any promise
const doStuff = async () => {
const result = await qew.push(asyncFunc);
// do stuff with `result`
// do something with `result`
}

```
Expand Down Expand Up @@ -112,7 +112,7 @@ function callback(err, result) {
```typescript
constructor Qew(maxConcurrent: number = 1, delay: number | (() => number) = 0): Qew;

Qew.push(func: () => Promise<T>, cb: (err: Error, result?: T) => void): this;
Qew.push(asyncFunc: () => Promise<T>): Promise<T>;
```

## Contributing
Expand Down
6 changes: 0 additions & 6 deletions jest.config.js

This file was deleted.

20 changes: 11 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "qew",
"version": "0.11.0",
"version": "0.11.1",
"description": "Queue asynchronous functions",
"source": "qew.ts",
"main": "dist/qew.js",
Expand All @@ -10,21 +10,23 @@
"scripts": {
"start": "microbundle watch",
"build": "microbundle",
"test": "jest",
"watch": "tsc -w",
"prepublish": "npm run build"
},
"keywords": [
"queue",
"async"
"async",
"throttle",
"promise"
],
"author": "",
"author": {
"name": "Aron Adler",
"email": "[email protected]",
"url": "https://adler.dev/"
},
"license": "MIT",
"repository": "Arrow7000/qew",
"repository": "github:Arrow7000/qew",
"devDependencies": {
"@types/jest": "^25.1.0",
"jest": "^25.1.0",
"microbundle": "^0.11.0",
"ts-jest": "^25.0.0"
"microbundle": "^0.11.0"
}
}
39 changes: 0 additions & 39 deletions qew.test.ts

This file was deleted.

5 changes: 1 addition & 4 deletions qew.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
type AsyncFunc<T> = () => Promise<T>;
type DelayOrDelayer = number | (() => number);

function makeTriggerablePromise<T>(): [
Promise<T>,
(inp: T) => void,
Expand Down Expand Up @@ -47,7 +44,7 @@ export class Qew {
* whenever `asyncFunc` has been run and resolved. Or the Promise will reject
* if `asyncFunc`'s Promise rejects
*/
public push<T>(asyncFunc: AsyncFunc<T>) {
public push<T>(asyncFunc: () => Promise<T>) {
const [prom, resolveProm, rejectProm] = makeTriggerablePromise<T>();

const funcToRun = () => {
Expand Down
Loading

0 comments on commit 21e9520

Please sign in to comment.