diff --git a/packages/effect-fc/src/Component.ts b/packages/effect-fc/src/Component.ts index 8a21b5b..19e9726 100644 --- a/packages/effect-fc/src/Component.ts +++ b/packages/effect-fc/src/Component.ts @@ -8,11 +8,7 @@ export const TypeId: unique symbol = Symbol.for("@effect-fc/Component/Component" export type TypeId = typeof TypeId /** - * Interface representing an Effect-based React Component. - * - * This is both: - * - an Effect that produces a React function component - * - a constructor-like object with component metadata and options + * Represents an Effect-based React Component that integrates the Effect system with React. */ export interface Component
extends ComponentPrototype
, ComponentOptions { @@ -98,18 +94,25 @@ const use = Effect.fnUntraced(function*
{value} + * }) + * ``` + * + * @example As an opaque type using class syntax + * ```tsx + * class MyComponent extends Component.make("MyComponent")(function* (props: { count: number }) { + * const value = yield* someEffect + * return
(
@@ -496,8 +563,10 @@ export const withRuntime: {
/**
- * Service that keeps track of scopes associated with React components
- * (used internally by the `useScope` hook).
+ * Internal Effect service that maintains a registry of scopes associated with React component instances.
+ *
+ * This service is used internally by the `useScope` hook to manage the lifecycle of component scopes,
+ * including tracking active scopes and coordinating their cleanup when components unmount or dependencies change.
*/
export class ScopeMap extends Effect.Service