MCPcopy Index your code
hub / github.com/Effect-TS/effect / when

Function when

packages/effect/src/internal/matcher.ts:263–281  ·  view source on GitHub ↗
(
  pattern: P,
  f: Fn
)

Source from the content-addressed store, hash-verified

261
262/** @internal */
263export const when = <
264 R,
265 const P extends Types.PatternPrimitive<R> | Types.PatternBase<R>,
266 Ret,
267 Fn extends (_: Types.WhenMatch<R, P>) => Ret
268>(
269 pattern: P,
270 f: Fn
271) =>
272<I, F, A, Pr>(
273 self: Matcher<I, F, R, A, Pr, Ret>
274): Matcher<
275 I,
276 Types.AddWithout<F, Types.PForExclude<P>>,
277 Types.ApplyFilters<I, Types.AddWithout<F, Types.PForExclude<P>>>,
278 A | ReturnType<Fn>,
279 Pr,
280 Ret
281> => (self as any).add(makeWhen(makePredicate(pattern), f as any))
282
283/** @internal */
284export const whenOr = <

Callers 11

Schedule.tst.tsFile · 0.85
Effect.tst.tsFile · 0.85
Struct.tst.tsFile · 0.85
Config.tst.tsFile · 0.85
Context.tst.tsFile · 0.85
Record.tst.tsFile · 0.85
Array.tst.tsFile · 0.85
Schema.tst.tsFile · 0.85
_f2Function · 0.85
Brand.tst.tsFile · 0.85
invalidateWhenMethod · 0.85

Calls 3

makeWhenFunction · 0.85
makePredicateFunction · 0.85
addMethod · 0.65

Tested by

no test coverage detected