MCPcopy Create free account
hub / github.com/Effect-TS/effect / provide

Method provide

packages/effect/src/testing/TestSchema.ts:559–567  ·  view source on GitHub ↗

* Returns a new Encoding instance with the given service injected into the encoding effect context. * * **When to use** * * Use when the schema's encoder requires a service dependency. * * @see Decoding.provide

(
    service: Context.Key<Id, Service>,
    implementation: Service
  )

Source from the content-addressed store, hash-verified

557 * @see {@link Decoding.provide}
558 */
559 provide<Id, Service>(
560 service: Context.Key<Id, Service>,
561 implementation: Service
562 ): Encoding<Schema.middlewareEncoding<S, Exclude<S["EncodingServices"], Id>>> {
563 return new Encoding(
564 pipe(this.schema, Schema.middlewareEncoding(Effect.provideService(service, implementation))),
565 this.options
566 )
567 }
568}

Callers

nothing calls this directly

Calls 1

pipeFunction · 0.90

Tested by

no test coverage detected