@thi.ng/wasm-api-schedule 0.2.0 → 0.2.1

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**: 2022-11-23T22:46:54Z
3
+ - **Last updated**: 2022-11-24T12:23:48Z
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.
package/README.md CHANGED
@@ -22,7 +22,8 @@ This project is part of the
22
22
 
23
23
  Delayed & scheduled function execution (via setTimeout() etc.) for hybrid WASM apps. This is a support package for [@thi.ng/wasm-api](https://github.com/thi-ng/umbrella/tree/develop/packages/wasm-api).
24
24
 
25
- The package provides a WASM bridge API and abstraction for scheduling function calls via:
25
+ The package provides a WASM bridge API and abstraction for scheduling function
26
+ calls via:
26
27
 
27
28
  - **once**: `setTimeout()` / `clearTimeout()`
28
29
  - **interval**: `setInterval()` / `clearInterval()`
@@ -47,8 +48,8 @@ try schedule.init(customAllocator);
47
48
  // user callback function
48
49
  fn exampleCallback(raw: ?*anyopaque) void {
49
50
  if (wasm.ptrCast(*u32, raw)) |state| {
50
- // do something ...
51
- }
51
+ // do something ...
52
+ }
52
53
  }
53
54
 
54
55
  // arbitrary user state
@@ -57,17 +58,20 @@ var state: u32 = 0xdecafbad;
57
58
  // schedule a single/one-off callback 500ms in the future
58
59
  const listenerID = try schedule.schedule(
59
60
  .once,
60
- &.{ .callback = exampleCallback, .ctx = &state },
61
61
  500,
62
+ exampleCallback,
63
+ &state,
62
64
  );
63
65
 
64
66
  // ...or maybe cancel it again
65
67
  schedule.cancel(listenerID);
66
68
  ```
67
69
 
68
- Also see
70
+ Also see the
69
71
  [zig-counter](https://github.com/thi-ng/umbrella/blob/develop/examples/zig-counter/)
70
- example project for more advanced usage...
72
+ and
73
+ [zig-todo-list](https://github.com/thi-ng/umbrella/blob/develop/examples/zig-todo-list/)
74
+ example projects for more advanced usage...
71
75
 
72
76
  ## Status
73
77
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@thi.ng/wasm-api-schedule",
3
- "version": "0.2.0",
3
+ "version": "0.2.1",
4
4
  "description": "Delayed & scheduled function execution (via setTimeout() etc.) for hybrid WASM apps",
5
5
  "type": "module",
6
6
  "module": "./index.js",
@@ -36,8 +36,8 @@
36
36
  },
37
37
  "dependencies": {
38
38
  "@thi.ng/api": "^8.4.6",
39
- "@thi.ng/wasm-api": "^1.0.0",
40
- "@thi.ng/wasm-api-bindgen": "^0.1.0"
39
+ "@thi.ng/wasm-api": "^1.0.1",
40
+ "@thi.ng/wasm-api-bindgen": "^0.2.0"
41
41
  },
42
42
  "devDependencies": {
43
43
  "@microsoft/api-extractor": "^7.33.5",
@@ -92,5 +92,5 @@
92
92
  "status": "alpha",
93
93
  "year": 2022
94
94
  },
95
- "gitHead": "044ee6a3895720fc78e115032d4d831b63510929\n"
95
+ "gitHead": "8d59e559a576ecb3d2c2d13edf5c3146df95d6ac\n"
96
96
  }