@@ -182,6 +182,10 @@ The component scope is created when React mounts the component and closes when
|
|||||||
React unmounts it. When the scope closes, Effect runs the finalizers registered
|
React unmounts it. When the scope closes, Effect runs the finalizers registered
|
||||||
inside that scope.
|
inside that scope.
|
||||||
|
|
||||||
|
Finalizers are forked when the scope closes, so cleanup logic can run
|
||||||
|
asynchronous Effects even though the component body itself must stay
|
||||||
|
synchronous.
|
||||||
|
|
||||||
```tsx title="src/MountedMessageView.tsx"
|
```tsx title="src/MountedMessageView.tsx"
|
||||||
import { Console, Effect } from "effect"
|
import { Console, Effect } from "effect"
|
||||||
import { Component } from "effect-fc"
|
import { Component } from "effect-fc"
|
||||||
|
|||||||
Reference in New Issue
Block a user