time-queues 1.0.2 → 1.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/LICENSE CHANGED
@@ -1,6 +1,6 @@
1
1
  BSD 3-Clause License
2
2
 
3
- Copyright (c) 2024, Eugene Lazutkin
3
+ Copyright (c) 2005-2024, Eugene Lazutkin
4
4
  All rights reserved.
5
5
 
6
6
  Redistribution and use in source and binary forms, with or without
package/README.md CHANGED
@@ -63,8 +63,9 @@ Don't forget to look at a test web application that uses the library. For that y
63
63
  npm start
64
64
  ```
65
65
 
66
- And navigate to http://localhost:3000/tests/web/test.html — don't forget to open the console and
67
- play around: switch tabs, make other window active, navigate away and come back, and so on.
66
+ And navigate to [http://localhost:3000/tests/web/](http://localhost:3000/tests/web/) —
67
+ don't forget to open the console and play around: switch tabs, make other window active,
68
+ navigate away and come back, and so on.
68
69
  See how queues work in [tests/web/test.js](https://github.com/uhop/time-queues/blob/main/tests/web/test.js).
69
70
 
70
71
  ## Usage
@@ -329,6 +330,8 @@ This project is licensed under the BSD-3-Clause License.
329
330
 
330
331
  ## Release History
331
332
 
333
+ * 1.0.4 *Bug fixes and code simplifications.*
334
+ * 1.0.3 *Updated deps (`list-toolkit`) to fix a minor bug.*
332
335
  * 1.0.2 *Updated deps (`list-toolkit`).*
333
336
  * 1.0.1 *Minor update in README. No need to upgrade.*
334
337
  * 1.0.0 *Initial release.*
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "time-queues",
3
- "version": "1.0.2",
3
+ "version": "1.0.4",
4
4
  "description": "Time queues to organize multitasking and scheduled tasks.",
5
5
  "type": "module",
6
6
  "exports": {
@@ -8,6 +8,9 @@
8
8
  },
9
9
  "scripts": {
10
10
  "test": "tape6 --flags FO",
11
+ "test:bun": "tape6-bun --flags FO",
12
+ "test:deno-original": "tape6-deno --flags FO",
13
+ "test:deno": "deno run -A `tape6-runner main` --flags FO",
11
14
  "start": "tape6-server --trace"
12
15
  },
13
16
  "repository": {
@@ -20,6 +23,7 @@
20
23
  "queue"
21
24
  ],
22
25
  "author": "Eugene Lazutkin <eugene.lazutkin@gmail.com> (https://www.lazutkin.com/)",
26
+ "funding": "https://github.com/sponsors/uhop",
23
27
  "license": "BSD-3-Clause",
24
28
  "bugs": {
25
29
  "url": "https://github.com/uhop/time-queues/issues"
@@ -31,12 +35,18 @@
31
35
  "tape6": {
32
36
  "tests": [
33
37
  "/tests/test-*.*js"
34
- ]
38
+ ],
39
+ "importmap": {
40
+ "imports": {
41
+ "tape-six": "/node_modules/tape-six/index.js",
42
+ "time-queues/": "/src/"
43
+ }
44
+ }
35
45
  },
36
46
  "devDependencies": {
37
- "tape-six": "^0.9.5"
47
+ "tape-six": "^0.12.2"
38
48
  },
39
49
  "dependencies": {
40
- "list-toolkit": "^2.0.0"
50
+ "list-toolkit": "^2.1.1"
41
51
  }
42
52
  }
package/src/ListQueue.js CHANGED
@@ -40,12 +40,7 @@ export class ListQueue extends MicroTaskQueue {
40
40
  }
41
41
 
42
42
  dequeue(task) {
43
- for (const node of this.list.getNodeIterator()) {
44
- if (node.value === task) {
45
- List.pop(node);
46
- break;
47
- }
48
- }
43
+ List.pop(task);
49
44
  if (!this.paused && this.list.isEmpty && this.stopQueue)
50
45
  this.stopQueue = (this.stopQueue(), null);
51
46
  return this;
@@ -1,13 +1,13 @@
1
1
  'use strict';
2
2
 
3
- import List from 'list-toolkit/list.js';
3
+ import ValueList from 'list-toolkit/value-list.js';
4
4
 
5
- const waitingForDom = new List();
5
+ const waitingForDom = new ValueList();
6
6
 
7
7
  export const remove = fn => {
8
8
  for (const node of waitingForDom.getNodeIterable()) {
9
9
  if (node.value === fn) {
10
- List.pop(node);
10
+ ValueList.pop(node);
11
11
  return true;
12
12
  }
13
13
  }
@@ -1,13 +1,13 @@
1
1
  'use strict';
2
2
 
3
- import List from 'list-toolkit/list.js';
3
+ import ValueList from 'list-toolkit/value-list.js';
4
4
 
5
- const waitingForLoad = new List();
5
+ const waitingForLoad = new ValueList();
6
6
 
7
7
  export const remove = fn => {
8
8
  for (const node of waitingForLoad.getNodeIterable()) {
9
9
  if (node.value === fn) {
10
- List.pop(node);
10
+ ValueList.pop(node);
11
11
  return true;
12
12
  }
13
13
  }