@effectionx/raf 1.0.0-alpha.0 → 1.0.0-alpha.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/README.md +5 -4
- package/esm/raf.d.ts +1 -1
- package/esm/raf.js +1 -1
- package/package.json +5 -1
- package/script/raf.d.ts +1 -1
- package/script/raf.js +1 -1
package/README.md
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
# RAF: Request Animation Frame
|
|
2
2
|
|
|
3
|
-
Subscribe to a stream of
|
|
4
|
-
|
|
3
|
+
Subscribe to a stream of
|
|
4
|
+
[Request Animation Frame](https://developer.mozilla.org/en-US/docs/Web/API/DedicatedWorkerGlobalScope/requestAnimationFrame)
|
|
5
|
+
updates.
|
|
5
6
|
|
|
6
7
|
---
|
|
7
8
|
|
|
@@ -10,9 +11,9 @@ import { each, main, suspend } from "effection";
|
|
|
10
11
|
import { raf } from "@effectionx/raf";
|
|
11
12
|
|
|
12
13
|
await main(function* () {
|
|
13
|
-
for (const
|
|
14
|
+
for (const timestamp of yield* each(raf)) {
|
|
14
15
|
// add your handler code here
|
|
15
|
-
console.log(
|
|
16
|
+
console.log(timestamp);
|
|
16
17
|
yield* each.next();
|
|
17
18
|
}
|
|
18
19
|
});
|
package/esm/raf.d.ts
CHANGED
package/esm/raf.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@effectionx/raf",
|
|
3
|
-
"version": "1.0.0-alpha.
|
|
3
|
+
"version": "1.0.0-alpha.1",
|
|
4
4
|
"author": "engineering@frontside.com",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -18,9 +18,13 @@
|
|
|
18
18
|
"require": "./script/mod.js"
|
|
19
19
|
}
|
|
20
20
|
},
|
|
21
|
+
"scripts": {},
|
|
21
22
|
"engines": {
|
|
22
23
|
"node": ">= 16"
|
|
23
24
|
},
|
|
24
25
|
"sideEffects": false,
|
|
26
|
+
"dependencies": {
|
|
27
|
+
"effection": "^3"
|
|
28
|
+
},
|
|
25
29
|
"_generatedBy": "dnt@dev"
|
|
26
30
|
}
|
package/script/raf.d.ts
CHANGED
package/script/raf.js
CHANGED
|
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.raf = void 0;
|
|
4
4
|
const effection_1 = require("effection");
|
|
5
5
|
/**
|
|
6
|
-
*
|
|
6
|
+
* A stream that produces animation frames.
|
|
7
7
|
*/
|
|
8
8
|
exports.raf = (0, effection_1.resource)(function* (provide) {
|
|
9
9
|
let signal = (0, effection_1.createSignal)();
|