summaryrefslogtreecommitdiffhomepage
path: root/cloud/app/src/context
diff options
context:
space:
mode:
authorDax Raad <[email protected]>2025-08-30 15:20:40 -0400
committerDax Raad <[email protected]>2025-08-30 15:20:51 -0400
commitc676f12306b58a87006e0f2114f5c7f2cb25a49d (patch)
tree326faf9f4209aa11011ea23261c03cdc70b72e54 /cloud/app/src/context
parentdac821229eba42d8680895db068c3ce1632d046c (diff)
downloadopencode-c676f12306b58a87006e0f2114f5c7f2cb25a49d.tar.gz
opencode-c676f12306b58a87006e0f2114f5c7f2cb25a49d.zip
wip: cloud
Diffstat (limited to 'cloud/app/src/context')
-rw-r--r--cloud/app/src/context/auth.withActor.ts9
1 files changed, 9 insertions, 0 deletions
diff --git a/cloud/app/src/context/auth.withActor.ts b/cloud/app/src/context/auth.withActor.ts
index a61b728ef..ca38be89b 100644
--- a/cloud/app/src/context/auth.withActor.ts
+++ b/cloud/app/src/context/auth.withActor.ts
@@ -1,7 +1,16 @@
import { Actor } from "@opencode/cloud-core/actor.js"
import { getActor } from "./auth"
+import { query } from "@solidjs/router"
export async function withActor<T>(fn: () => T) {
const actor = await getActor()
return Actor.provide(actor.type, actor.properties, fn)
}
+
+export function actorQuery<T>(cb: () => T, name: string) {
+ "use server"
+ return query(async () => {
+ const actor = await getActor()
+ return withActor(cb)
+ }, name)
+}