Skip to content

Commit 6b579bc

Browse files
committed
add query test
1 parent 9201519 commit 6b579bc

2 files changed

Lines changed: 23 additions & 0 deletions

File tree

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
"use server";
2+
3+
import { query } from "@solidjs/router";
4+
import { isServer } from "solid-js/web";
5+
6+
export const testQuery = query(() => isServer, 'testQuery');
7+
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
import { createEffect, createSignal } from "solid-js";
2+
import * as testModule from "~/functions/solid-router-query";
3+
4+
export default function App() {
5+
const [output, setOutput] = createSignal<{ serverFnWithMeta?: boolean }>({});
6+
7+
createEffect(() => {
8+
setOutput(prev => ({ ...prev, serverFnWithMeta: 'testQuery' in testModule }));
9+
});
10+
11+
return (
12+
<main>
13+
<span id="server-fn-test">{JSON.stringify(output())}</span>
14+
</main>
15+
);
16+
}

0 commit comments

Comments
 (0)