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 / 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 );