mirror of
https://github.com/aljazceru/opencode.git
synced 2025-12-27 12:44:22 +01:00
wip: zen
This commit is contained in:
@@ -1,16 +1,7 @@
|
||||
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)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user