GET

GET returns the .GET property from a function.


Import

import { GET } from "@solidjs/start";

Type

function GET<T extends (...args: any[]) => any>(
fn: T
): (...args: Parameters<T>) => ReturnType<T>;

Parameters

fn

  • Type: T extends (...args: any[]) => any
  • Required: Yes

Function with a GET property.


Return value

  • Type: (...args: Parameters<T>) => ReturnType<T>

Returns fn.GET.


Examples

Basic usage

import { GET } from "@solidjs/start";
const getMessage = Object.assign(async () => "hello", {
GET: async () => "hello",
});
const handler = GET(getMessage);
Last updated: 5/6/26, 4:10 AMEdit this pageReport an issue with this page