@thi.ng/transducers-async 0.3.4 → 0.3.6

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/CHANGELOG.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # Change Log
2
2
 
3
- - **Last updated**: 2024-12-12T10:11:58Z
3
+ - **Last updated**: 2024-12-27T14:11:37Z
4
4
  - **Generator**: [thi.ng/monopub](https://thi.ng/monopub)
5
5
 
6
6
  All notable changes to this project will be documented in this file.
@@ -9,6 +9,14 @@ See [Conventional Commits](https://conventionalcommits.org/) for commit guidelin
9
9
  **Note:** Unlisted _patch_ versions only involve non-code or otherwise excluded changes
10
10
  and/or version bumps of transitive dependencies.
11
11
 
12
+ ### [0.3.6](https://github.com/thi-ng/umbrella/tree/@thi.ng/transducers-async@0.3.6) (2024-12-27)
13
+
14
+ #### ♻️ Refactoring
15
+
16
+ - update `throttleTime()` ([87e5ed3](https://github.com/thi-ng/umbrella/commit/87e5ed3))
17
+ - add [@thi.ng/timestamp](https://github.com/thi-ng/umbrella/tree/main/packages/timestamp) micro dependency
18
+ - update timestamp handling (more precise in some contexts)
19
+
12
20
  ## [0.3.0](https://github.com/thi-ng/umbrella/tree/@thi.ng/transducers-async@0.3.0) (2024-10-14)
13
21
 
14
22
  #### 🚀 Features
package/README.md CHANGED
@@ -7,7 +7,7 @@
7
7
  [![Mastodon Follow](https://img.shields.io/mastodon/follow/109331703950160316?domain=https%3A%2F%2Fmastodon.thi.ng&style=social)](https://mastodon.thi.ng/@toxi)
8
8
 
9
9
  > [!NOTE]
10
- > This is one of 199 standalone projects, maintained as part
10
+ > This is one of 200 standalone projects, maintained as part
11
11
  > of the [@thi.ng/umbrella](https://github.com/thi-ng/umbrella/) monorepo
12
12
  > and anti-framework.
13
13
  >
@@ -116,7 +116,7 @@ For Node.js REPL:
116
116
  const txa = await import("@thi.ng/transducers-async");
117
117
  ```
118
118
 
119
- Package sizes (brotli'd, pre-treeshake): ESM: 3.20 KB
119
+ Package sizes (brotli'd, pre-treeshake): ESM: 3.22 KB
120
120
 
121
121
  ## Dependencies
122
122
 
@@ -125,6 +125,7 @@ Package sizes (brotli'd, pre-treeshake): ESM: 3.20 KB
125
125
  - [@thi.ng/checks](https://github.com/thi-ng/umbrella/tree/develop/packages/checks)
126
126
  - [@thi.ng/compose](https://github.com/thi-ng/umbrella/tree/develop/packages/compose)
127
127
  - [@thi.ng/errors](https://github.com/thi-ng/umbrella/tree/develop/packages/errors)
128
+ - [@thi.ng/timestamp](https://github.com/thi-ng/umbrella/tree/develop/packages/timestamp)
128
129
  - [@thi.ng/transducers](https://github.com/thi-ng/umbrella/tree/develop/packages/transducers)
129
130
 
130
131
  Note: @thi.ng/api is in _most_ cases a type-only import (not used at runtime)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@thi.ng/transducers-async",
3
- "version": "0.3.4",
3
+ "version": "0.3.6",
4
4
  "description": "Async versions of various highly composable transducers, reducers and iterators",
5
5
  "type": "module",
6
6
  "module": "./index.js",
@@ -19,6 +19,10 @@
19
19
  {
20
20
  "type": "patreon",
21
21
  "url": "https://patreon.com/thing_umbrella"
22
+ },
23
+ {
24
+ "type": "liberapay",
25
+ "url": "https://liberapay.com/thi.ng"
22
26
  }
23
27
  ],
24
28
  "author": "Karsten Schmidt (https://thi.ng)",
@@ -36,17 +40,18 @@
36
40
  "tool:tangle": "../../node_modules/.bin/tangle src/**/*.ts"
37
41
  },
38
42
  "dependencies": {
39
- "@thi.ng/api": "^8.11.14",
40
- "@thi.ng/buffers": "^0.1.17",
41
- "@thi.ng/checks": "^3.6.16",
42
- "@thi.ng/compose": "^3.0.17",
43
- "@thi.ng/errors": "^2.5.20",
44
- "@thi.ng/transducers": "^9.2.10"
43
+ "@thi.ng/api": "^8.11.15",
44
+ "@thi.ng/buffers": "^0.2.1",
45
+ "@thi.ng/checks": "^3.6.17",
46
+ "@thi.ng/compose": "^3.0.18",
47
+ "@thi.ng/errors": "^2.5.21",
48
+ "@thi.ng/timestamp": "^1.1.0",
49
+ "@thi.ng/transducers": "^9.2.11"
45
50
  },
46
51
  "devDependencies": {
47
- "@microsoft/api-extractor": "^7.48.0",
48
- "esbuild": "^0.24.0",
49
- "typedoc": "^0.27.4",
52
+ "@microsoft/api-extractor": "^7.48.1",
53
+ "esbuild": "^0.24.2",
54
+ "typedoc": "^0.27.6",
50
55
  "typescript": "^5.7.2"
51
56
  },
52
57
  "keywords": [
@@ -208,5 +213,5 @@
208
213
  "status": "alpha",
209
214
  "year": 2018
210
215
  },
211
- "gitHead": "34ac95538d96f046090fef5fd3a1dc36d54663d5\n"
216
+ "gitHead": "48bf4c22bf23f88ac99f435106af2214f79a0be1\n"
212
217
  }
package/throttle-time.js CHANGED
@@ -1,11 +1,12 @@
1
+ import { now, timeDiff } from "@thi.ng/timestamp";
1
2
  import { iterator1 } from "./iterator.js";
2
3
  import { throttle } from "./throttle.js";
3
4
  function throttleTime(delay, src) {
4
5
  return src ? iterator1(throttleTime(delay), src) : throttle(() => {
5
- let last = 0;
6
+ let prev = 0;
6
7
  return () => {
7
- const t = Date.now();
8
- return t - last >= delay ? (last = t, true) : false;
8
+ const t = now();
9
+ return timeDiff(prev, t) >= delay ? (prev = t, true) : false;
9
10
  };
10
11
  });
11
12
  }