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

Function warnOnce

packages/effect/src/ui/internal/codecRun.ts:30–44  ·  view source on GitHub ↗
(
  kind: string,
  inst: Kernel.Instance,
  ctx: Context.Context<any>,
  message: () => string
)

Source from the content-addressed store, hash-verified

28
29/** @internal */
30export const warnOnce = (
31 kind: string,
32 inst: Kernel.Instance,
33 ctx: Context.Context<any>,
34 message: () => string
35): void => {
36 const component = inst.component as unknown as Component.Any
37 let kinds = warned.get(component)
38 if (kinds === undefined) warned.set(component, kinds = new Set())
39 if (kinds.has(kind)) return
40 kinds.add(kind)
41 Effect.runForkWith(ctx)(
42 Effect.logWarning(`${component.definition.name}: ${message()}`)
43 )
44}
45
46const formatIssue = SchemaIssue.makeFormatterDefault()
47

Callers 4

warnRedactedFunction · 0.90
encodePropsFunction · 0.90
makeFunction · 0.90
warnUnencodedFunction · 0.70

Calls 5

getMethod · 0.65
setMethod · 0.65
hasMethod · 0.65
addMethod · 0.65
messageFunction · 0.50

Tested by

no test coverage detected