svelte-effect-runtime 1.0.0

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 ADDED
@@ -0,0 +1,40 @@
1
+ # svelte-effect-runtime
2
+
3
+ Client-side Effect runtime support for Svelte `<script>` blocks.
4
+
5
+ ## What it does
6
+
7
+ - Adds an opt-in `<script effect>` preprocessor for Svelte components
8
+ - Hoists declarations and wraps top-level executable statements in
9
+ `Effect.gen(...)`
10
+ - Runs the generated Effect once on mount
11
+ - Cancels it on unmount and HMR dispose
12
+ - Uses a parent-provided shared `ManagedRuntime`
13
+
14
+ ## Deno tasks
15
+
16
+ ```sh
17
+ deno task check
18
+ deno task test
19
+ ```
20
+
21
+ ## Main entrypoints
22
+
23
+ - `./mod.ts`
24
+ - `./client.ts`
25
+ - `./preprocess.ts`
26
+ - `./vite.ts`
27
+
28
+ ## Runtime composition
29
+
30
+ ```ts
31
+ import * as Layer from "effect/Layer";
32
+ import { ClientRuntime } from "svelte-effect-runtime";
33
+
34
+ export const init = () => {
35
+ ClientRuntime.make(
36
+ Layer.provide(MyApi.Live),
37
+ Layer.provide(Logger.Live),
38
+ );
39
+ };
40
+ ```