MCPcopy Create free account
hub / github.com/effect-app/libs / makeWith

Function makeWith

repos/effect/packages/effect/src/RequestResolver.ts:181–195  ·  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

179 * @see {@link makeGrouped} for constructing a resolver that groups requests by key
180 *
181 * @category constructors
182 * @since 4.0.0
183 */
184export const makeWith = <A extends Request.Any>(options: {
185 readonly batchKey: (request: Request.Entry<A>) => unknown
186 readonly preCheck?: ((entry: Request.Entry<A>) => boolean) | undefined
187 readonly delay: Effect.Effect<void>
188 readonly collectWhile: (requests: ReadonlySet<Request.Entry<A>>) => boolean
189 readonly runAll: (entries: NonEmptyArray<Request.Entry<A>>, key: unknown) => Effect.Effect<void, Request.Error<A>>
190}): RequestResolver<A> => {
191 const self = Object.create(RequestResolverProto)
192 self.batchKey = options.batchKey
193 self.preCheck = options.preCheck
194 self.delay = options.delay
195 self.collectWhile = options.collectWhile
196 self.runAll = options.runAll
197 return self
198}

Callers 3

makeFunction · 0.70
makeGroupedFunction · 0.70
RequestResolver.tsFile · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…