Skip to content

Instantly share code, notes, and snippets.

View mahdiboomeri's full-sized avatar

Mahdi Boomeri mahdiboomeri

View GitHub Profile
@mahdiboomeri
mahdiboomeri / useNonNullableSerializableFetch.ts
Created December 27, 2022 20:42
Just a POC, I don't recommend using it.
import type { FetchError } from "ofetch";
import type { NitroFetchRequest } from "nitropack";
import type { FetchResult, UseFetchOptions, AsyncData } from "#app";
import type {
KeyOfRes,
PickFrom,
_AsyncData,
} from "#app/composables/asyncData";
import type { Ref } from "vue";
import type { FetchError } from "ofetch";
import type { NitroFetchRequest } from "nitropack";
import type { FetchResult, UseFetchOptions, AsyncData } from "#app";
import type { KeyOfRes, PickFrom } from "#app/composables/asyncData";
import type { Ref } from "vue";
/**
* @see https://github.com/remix-run/remix/blob/2248669ed59fd716e267ea41df5d665d4781f4a9/packages/remix-server-runtime/serialize.ts
*/
type JsonPrimitive =