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

Function fromFunction

repos/effect/packages/effect/src/RequestResolver.ts:333–344  ·  view source on GitHub ↗
(
  f: (entry: Request.Entry<A>) => Request.Success<A>
)

Source from the content-addressed store, hash-verified

331 *
332 * // Create a resolver from a pure function
333 * const SquareResolver = RequestResolver.fromFunction<GetSquareRequest>(
334 * (entry) => entry.request.value * entry.request.value
335 * )
336 *
337 * // Usage
338 * const getSquareEffect = Effect.request(
339 * GetSquareRequest({ value: 5 }),
340 * SquareResolver
341 * )
342 * await Effect.runPromise(getSquareEffect) // => 25
343 * ```
344 *
345 * @category constructors
346 * @since 2.0.0
347 */

Callers

nothing calls this directly

Calls 4

syncMethod · 0.80
completeUnsafeMethod · 0.80
makeFunction · 0.70
fFunction · 0.50

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…