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

Function makeWith

packages/effect/src/RequestResolver.ts:193–207  ·  view source on GitHub ↗
(options: {
  readonly batchKey: (request: Request.Entry<A>) => unknown
  readonly preCheck?: ((entry: Request.Entry<A>) => boolean) | undefined
  readonly delay: Effect.Effect<void>
  readonly collectWhile: (requests: ReadonlySet<Request.Entry<A>>) => boolean
  readonly runAll: (entries: NonEmptyArray<Request.Entry<A>>, key: unknown) => Effect.Effect<void, Request.Error<A>>
})

Source from the content-addressed store, hash-verified

191 * @since 4.0.0
192 */
193export const makeWith = <A extends Request.Any>(options: {
194 readonly batchKey: (request: Request.Entry<A>) => unknown
195 readonly preCheck?: ((entry: Request.Entry<A>) => boolean) | undefined
196 readonly delay: Effect.Effect<void>
197 readonly collectWhile: (requests: ReadonlySet<Request.Entry<A>>) => boolean
198 readonly runAll: (entries: NonEmptyArray<Request.Entry<A>>, key: unknown) => Effect.Effect<void, Request.Error<A>>
199}): RequestResolver<A> => {
200 const self = Object.create(RequestResolverProto)
201 self.batchKey = options.batchKey
202 self.preCheck = options.preCheck
203 self.delay = options.delay
204 self.collectWhile = options.collectWhile
205 self.runAll = options.runAll
206 return self
207}
208
209const defaultKeyObject = {}
210const defaultKey = (_request: unknown): unknown => defaultKeyObject

Callers 3

makeFunction · 0.70
makeGroupedFunction · 0.70
RequestResolver.tsFile · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected