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

Method constructor

packages/effect/src/Metric.ts:1993–2005  ·  view source on GitHub ↗
(
    metric: Metric<Input, State>,
    valueUnsafe: (context: Context.Context<never>) => State,
    updateUnsafe: (input: Input2, context: Context.Context<never>) => void,
    modifyUnsafe: (input: Input2, context: Context.Context<never>) => void
  )

Source from the content-addressed store, hash-verified

1991 override readonly modifyUnsafe: (input: Input2, context: Context.Context<never>) => void
1992
1993 constructor(
1994 metric: Metric<Input, State>,
1995 valueUnsafe: (context: Context.Context<never>) => State,
1996 updateUnsafe: (input: Input2, context: Context.Context<never>) => void,
1997 modifyUnsafe: (input: Input2, context: Context.Context<never>) => void
1998 ) {
1999 super(metric.id, metric.description, metric.attributes)
2000 this.metric = metric
2001 this.valueUnsafe = valueUnsafe
2002 this.updateUnsafe = updateUnsafe
2003 this.modifyUnsafe = modifyUnsafe
2004 this.type = metric.type
2005 }
2006 createHooks(): Metric.Hooks<Input2, State> {
2007 return (this.metric as any).createHooks()
2008 }

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected