@typed/fx 2.0.0-beta.10 → 2.0.0-beta.11

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.
@@ -5,9 +5,9 @@ import type * as Effect from "effect/Effect";
5
5
  * @remarks
6
6
  * ## Why
7
7
  *
8
- * Effect 4's `Effectable.Class` evaluates to the object itself. Typed's yieldable objects instead
9
- * need `Effect.gen` to execute their `override` Effect. The prototype protocol installed below
10
- * returns that Effect and avoids recursively yielding the same object.
8
+ * Effect 4's `Effectable.Class` delegates evaluation to `asEffect`. Typed's yieldable objects
9
+ * implement that method by returning their `override` Effect, preserving the same sampling work
10
+ * when yielded in `Effect.gen` or executed directly.
11
11
  *
12
12
  * ## Ownership and lifetime
13
13
  *
@@ -51,5 +51,20 @@ export declare abstract class EffectableWithOverride<A, E = never, R = never> ex
51
51
  * @category effects
52
52
  */
53
53
  abstract override: Effect.Effect<A, E, R>;
54
+ /** Returns the Effect evaluated by Effect's runtime.
55
+ *
56
+ * @remarks
57
+ * ## Why
58
+ *
59
+ * Implements `Effectable.Class` through its public evaluation method.
60
+ *
61
+ * ## Ownership and lifetime
62
+ *
63
+ * Reading the Effect starts no work; subclasses retain ownership of its resources.
64
+ *
65
+ * @since 1.0.0
66
+ * @category effects
67
+ */
68
+ asEffect(): Effect.Effect<A, E, R>;
54
69
  }
55
70
  //# sourceMappingURL=effectableWithOverride.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"effectableWithOverride.d.ts","sourceRoot":"","sources":["../../../src/Fx/internal/effectableWithOverride.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAC;AACpC,OAAO,KAAK,KAAK,MAAM,MAAM,eAAe,CAAC;AAG7C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AACH,8BAAsB,sBAAsB,CAAC,CAAC,EAAE,CAAC,GAAG,KAAK,EAAE,CAAC,GAAG,KAAK,CAAE,SAAQ,UAAU,CAAC,KAAK,CAC5F,CAAC,EACD,CAAC,EACD,CAAC,CACF;IACC;;;;;;;;;;;;;;OAcG;IACH,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;CAC3C"}
1
+ {"version":3,"file":"effectableWithOverride.d.ts","sourceRoot":"","sources":["../../../src/Fx/internal/effectableWithOverride.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAC;AACpC,OAAO,KAAK,KAAK,MAAM,MAAM,eAAe,CAAC;AAE7C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AACH,8BAAsB,sBAAsB,CAAC,CAAC,EAAE,CAAC,GAAG,KAAK,EAAE,CAAC,GAAG,KAAK,CAAE,SAAQ,UAAU,CAAC,KAAK,CAC5F,CAAC,EACD,CAAC,EACD,CAAC,CACF;IACC;;;;;;;;;;;;;;OAcG;IACH,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;IAE1C;;;;;;;;;;;;;OAaG;IACH,QAAQ,IAAI,MAAM,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAEjC;CACF"}
@@ -1,13 +1,12 @@
1
1
  import { Effectable } from "effect";
2
- import { EFFECT_EVALUATE_KEY } from "./effectableEvaluateKey.js";
3
2
  /** Effectable base class whose generator evaluation delegates to an explicit Effect.
4
3
  *
5
4
  * @remarks
6
5
  * ## Why
7
6
  *
8
- * Effect 4's `Effectable.Class` evaluates to the object itself. Typed's yieldable objects instead
9
- * need `Effect.gen` to execute their `override` Effect. The prototype protocol installed below
10
- * returns that Effect and avoids recursively yielding the same object.
7
+ * Effect 4's `Effectable.Class` delegates evaluation to `asEffect`. Typed's yieldable objects
8
+ * implement that method by returning their `override` Effect, preserving the same sampling work
9
+ * when yielded in `Effect.gen` or executed directly.
11
10
  *
12
11
  * ## Ownership and lifetime
13
12
  *
@@ -35,12 +34,21 @@ import { EFFECT_EVALUATE_KEY } from "./effectableEvaluateKey.js";
35
34
  * @stability internal-but-published
36
35
  */
37
36
  export class EffectableWithOverride extends Effectable.Class {
38
- }
39
- // @effect-diagnostics-next-line floatingEffect:off
40
- Object.defineProperty(EffectableWithOverride.prototype, EFFECT_EVALUATE_KEY, {
41
- value: function () {
37
+ /** Returns the Effect evaluated by Effect's runtime.
38
+ *
39
+ * @remarks
40
+ * ## Why
41
+ *
42
+ * Implements `Effectable.Class` through its public evaluation method.
43
+ *
44
+ * ## Ownership and lifetime
45
+ *
46
+ * Reading the Effect starts no work; subclasses retain ownership of its resources.
47
+ *
48
+ * @since 1.0.0
49
+ * @category effects
50
+ */
51
+ asEffect() {
42
52
  return this.override;
43
- },
44
- configurable: true,
45
- writable: true,
46
- });
53
+ }
54
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@typed/fx",
3
- "version": "2.0.0-beta.10",
3
+ "version": "2.0.0-beta.11",
4
4
  "description": "Reactive streams and state for Typed applications.",
5
5
  "homepage": "https://github.com/TylorS/typed/tree/development/packages/fx#readme",
6
6
  "bugs": "https://github.com/TylorS/typed/issues",
@@ -129,11 +129,11 @@
129
129
  "access": "public"
130
130
  },
131
131
  "dependencies": {
132
- "effect": "4.0.0-rc.112"
132
+ "effect": "4.0.0-rc.115"
133
133
  },
134
134
  "devDependencies": {
135
135
  "typescript": "7.0.2",
136
- "vitest": "5.0.0"
136
+ "vitest": "5.0.1"
137
137
  },
138
138
  "scripts": {
139
139
  "build": "node -e \"const fs=require('node:fs'); fs.rmSync('dist',{recursive:true,force:true}); fs.rmSync('tsconfig.tsbuildinfo',{force:true})\" && tsc",