* Returns a new Decoding instance with the given service injected into the decoding effect context. * * **When to use** * * Use when the schema's decoder requires a service dependency. * * @see Encoding.provide
(
service: Context.Key<Id, Service>,
implementation: Service
)
| 417 | * @see {@link Encoding.provide} |
| 418 | */ |
| 419 | provide<Id, Service>( |
| 420 | service: Context.Key<Id, Service>, |
| 421 | implementation: Service |
| 422 | ): Decoding<Schema.middlewareDecoding<S, Exclude<S["DecodingServices"], Id>>> { |
| 423 | return new Decoding( |
| 424 | pipe(this.schema, Schema.middlewareDecoding(Effect.provideService(service, implementation))), |
| 425 | this.options |
| 426 | ) |
| 427 | } |
| 428 | } |
| 429 | |
| 430 | /** |