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

Function make

packages/effect/src/internal/metric.ts:51–76  ·  view source on GitHub ↗
(
  keyType: Type,
  unsafeUpdate: (input: In, extraTags: ReadonlyArray<MetricLabel.MetricLabel>) => void,
  unsafeValue: (extraTags: ReadonlyArray<MetricLabel.MetricLabel>) => Out,
  unsafeModify: (input: In, extraTags: ReadonlyArray<MetricLabel.MetricLabel>) => void
)

Source from the content-addressed store, hash-verified

49
50/** @internal */
51export const make: Metric.MetricApply = function<Type, In, Out>(
52 keyType: Type,
53 unsafeUpdate: (input: In, extraTags: ReadonlyArray<MetricLabel.MetricLabel>) => void,
54 unsafeValue: (extraTags: ReadonlyArray<MetricLabel.MetricLabel>) => Out,
55 unsafeModify: (input: In, extraTags: ReadonlyArray<MetricLabel.MetricLabel>) => void
56): Metric.Metric<Type, In, Out> {
57 const metric: Metric.Metric<Type, In, Out> = Object.assign(
58 <A extends In, E, R>(effect: Effect.Effect<A, E, R>): Effect.Effect<A, E, R> =>
59 core.tap(effect, (a) => update(metric, a)),
60 {
61 [MetricTypeId]: metricVariance,
62 keyType,
63 unsafeUpdate,
64 unsafeValue,
65 unsafeModify,
66 register() {
67 this.unsafeValue([])
68 return this as any
69 },
70 pipe() {
71 return pipeArguments(this, arguments)
72 }
73 } as const
74 )
75 return metric
76}
77
78/** @internal */
79export const mapInput = dual<

Callers 4

metric.tsFile · 0.70
fromMetricKeyFunction · 0.70
succeedFunction · 0.70
syncFunction · 0.70

Calls 1

updateFunction · 0.70

Tested by

no test coverage detected