refactor(account): tighten effect-based account flows (#17072)

This commit is contained in:
Kit Langton
2026-03-11 14:18:58 -04:00
committed by GitHub
parent 2aae0d3493
commit 981c7b9e37
9 changed files with 390 additions and 354 deletions

View File

@@ -1,4 +1,4 @@
import { Effect, Option, ServiceMap } from "effect"
import { Effect, Option } from "effect"
import {
Account as AccountSchema,
@@ -13,13 +13,11 @@ export { AccessToken, AccountID, OrgID } from "./service"
import { runtime } from "@/effect/runtime"
type AccountServiceShape = ServiceMap.Service.Shape<typeof AccountService>
function runSync<A>(f: (service: AccountServiceShape) => Effect.Effect<A, AccountError>) {
function runSync<A>(f: (service: AccountService.Service) => Effect.Effect<A, AccountError>) {
return runtime.runSync(AccountService.use(f))
}
function runPromise<A>(f: (service: AccountServiceShape) => Effect.Effect<A, AccountError>) {
function runPromise<A>(f: (service: AccountService.Service) => Effect.Effect<A, AccountError>) {
return runtime.runPromise(AccountService.use(f))
}