Skip to content

Instantly share code, notes, and snippets.

View mastermakrela's full-sized avatar

Christoph mastermakrela

View GitHub Profile
@STBoyden
STBoyden / effect-remote-functions-with-promiseexit.ts
Last active January 13, 2026 01:14
Effect.ts + SvelteKit remote functions
import type { RemoteFormInput } from "@sveltejs/kit";
import { command, form, query } from "$app/server";
import { Effect, Schema } from "effect";
/**
* Creates a remote query defined with `Effect`. Shares the same behaviour as
* SvelteKit's `query`.
*
* @param schema The `Schema` to validate arguments against.
* @param handler The `Effect` to run when this function is ran.
<svg width="300" height="300" viewBox="0 0 300 300">
<defs>
<filter id="paperEffect">
<feTurbulence
type="fractalNoise"
baseFrequency="0.04"
numOctaves="5"
result="noise"
/>
<feDiffuseLighting