0.1.8 #11

Merged
Thilawyn merged 233 commits from next into master 2025-04-21 02:08:14 +02:00
2 changed files with 8 additions and 8 deletions
Showing only changes of commit d55b432846 - Show all commits

View File

@@ -18,4 +18,4 @@ export class AppQueryErrorHandler extends ErrorHandler.Service<AppQueryErrorHand
),
) {}
export class AppQueryClient extends QueryClient.Service({ ErrorHandler: AppQueryErrorHandler })<AppQueryClient>() {}
export class AppQueryClient extends QueryClient.Service<AppQueryClient>()({ ErrorHandler: AppQueryErrorHandler }) {}

View File

@@ -23,13 +23,13 @@ export interface ServiceResult<Self, EH, HandledE> extends Context.TagClass<Self
readonly Live: Layer.Layer<Self>
}
export const Service = <
export const Service = <Self>() => (
<
EH = ErrorHandler.DefaultErrorHandler,
HandledE = ErrorHandler.Error<Context.Tag.Service<ErrorHandler.DefaultErrorHandler>>,
>(
>(
props?: ServiceProps<EH, HandledE>
) => (
<Self>(): ServiceResult<Self, EH, HandledE> => {
): ServiceResult<Self, EH, HandledE> => {
const TagClass = Context.Tag(id)() as ServiceResult<Self, EH, HandledE>
(TagClass as Mutable<typeof TagClass>).Live = Layer.succeed(TagClass, {
ErrorHandler: (props?.ErrorHandler ?? ErrorHandler.DefaultErrorHandler) as Context.Tag<EH, ErrorHandler.ErrorHandler<HandledE>>