( schema: S, build: Effect.Effect<S["Type"], never, R2> )
| 90 | * @since 4.0.0 |
| 91 | */ |
| 92 | export const layerInitialMessage = <S extends Schema.Constraint, R2>( |
| 93 | schema: S, |
| 94 | build: Effect.Effect<S["Type"], never, R2> |
| 95 | ): Layer.Layer<InitialMessage, never, S["EncodingServices"] | R2> => |
| 96 | Layer.effect(InitialMessage)( |
| 97 | Effect.contextWith((context: Context.Context<S["EncodingServices"] | R2>) => |
| 98 | Effect.succeed( |
| 99 | Effect.provideContext(Effect.orDie(makeInitialMessage(schema, build)), context) |
| 100 | ) |
| 101 | ) |
| 102 | ) |
| 103 | |
| 104 | /** |
| 105 | * Reads the protocol initial message and decodes it with the supplied schema, |
nothing calls this directly
no test coverage detected