@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 CHANGED
@@ -1,7 +1,8 @@
1
1
  # RAF: Request Animation Frame
2
2
 
3
- Subscribe to a stream of Request Animation Frame updates with an Effection
4
- resource.
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 frame of yield* each(raf)) {
14
+ for (const timestamp of yield* each(raf)) {
14
15
  // add your handler code here
15
- console.log(frame);
16
+ console.log(timestamp);
16
17
  yield* each.next();
17
18
  }
18
19
  });
package/esm/raf.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import { type Stream } from "effection";
2
2
  /**
3
- * Consume RAF's as a Stream.
3
+ * A stream that produces animation frames.
4
4
  */
5
5
  export declare const raf: Stream<number, never>;
6
6
  //# sourceMappingURL=raf.d.ts.map
package/esm/raf.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { createSignal, resource } from "effection";
2
2
  /**
3
- * Consume RAF's as a Stream.
3
+ * A stream that produces animation frames.
4
4
  */
5
5
  export const raf = resource(function* (provide) {
6
6
  let signal = createSignal();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@effectionx/raf",
3
- "version": "1.0.0-alpha.0",
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
@@ -1,6 +1,6 @@
1
1
  import { type Stream } from "effection";
2
2
  /**
3
- * Consume RAF's as a Stream.
3
+ * A stream that produces animation frames.
4
4
  */
5
5
  export declare const raf: Stream<number, never>;
6
6
  //# sourceMappingURL=raf.d.ts.map
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
- * Consume RAF's as a Stream.
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)();