Tests
Some checks failed
Lint / lint (push) Failing after 9s

This commit is contained in:
Julien Valverdé
2025-01-15 00:37:00 +01:00
parent 9f08894b61
commit 52b7b071f4

View File

@@ -1,4 +1,4 @@
import { Context, Layer } from "effect"
import { Context, Effect, Layer } from "effect"
import React from "react"
@@ -8,7 +8,7 @@ export interface ReffuseContext<R> {
}
export type ReffuseContextReactProvider<R> = React.FC<{
readonly layer: Layer.Layer<R, unknown>
readonly layer: Layer.Layer<R, unknown, never>
readonly children?: React.ReactNode
}>
@@ -30,3 +30,18 @@ export function make<R>(): ReffuseContext<R> {
},
}
}
declare const MyService1: ReturnType<typeof Context.GenericTag<"MyService1", { readonly myService1: true }>>
declare const MyService2: ReturnType<typeof Context.GenericTag<"MyService2", { readonly myService2: true }>>
declare const Context1: Context.Context<typeof MyService1>
declare const Context2: Context.Context<typeof MyService2>
declare const MyService3: ReturnType<typeof Context.GenericTag<"MyService3", { readonly myService3: true }>>
declare const MyService3Live: Layer.Layer<typeof MyService3, never, typeof MyService1>
const res = MyService3Live.pipe(
Layer.provide(Layer.effectContext(Effect.succeed(Context1)))
)