Skip to content

Instantly share code, notes, and snippets.

View dualjack's full-sized avatar
🧡
xdd

Jakub dualjack

🧡
xdd
  • jetplugs.com
View GitHub Profile
@dualjack
dualjack / superForm.svelte.ts
Created April 4, 2026 17:18
SuperFormRunes - Svelte5 SuperForms with Runes support.
import {type FormOptions, superForm, type SuperValidated} from "sveltekit-superforms";
import {fromStoreTwoWayBinding} from "@dualjack/svelte-tools";
import {tick, untrack} from "svelte";
import {createAttachmentKey, fromAction} from "svelte/attachments";
export function superFormRunes<
T extends Record<string, unknown> = Record<string, unknown>,
M = any,
In extends Record<string, unknown> = T
>(formValidated: SuperValidated<T, M, In>|(() => SuperValidated<T, M, In>), formOptions?: FormOptions<T, M, In>){
@dualjack
dualjack / fetchTools.ts
Created October 24, 2023 12:19
Sveltekit fetch action wrapper
import type {ActionResult} from "@sveltejs/kit";
import {applyAction, deserialize} from "$app/forms";
export const fetchAction = async <Input, Output>(actionPath: string, data: Input): Promise<Output> => {
const result: ActionResult = await fetch(actionPath, {
method: 'POST',
headers: {
'x-sveltekit-action': 'true'
},
$listTable = new ListTable_SubscribersAjax( 'my_fancy_table );