( keyType: Type, unsafeUpdate: (input: In, extraTags: ReadonlyArray<MetricLabel.MetricLabel>) => void, unsafeValue: (extraTags: ReadonlyArray<MetricLabel.MetricLabel>) => Out, unsafeModify: (input: In, extraTags: ReadonlyArray<MetricLabel.MetricLabel>) => void )
| 49 | |
| 50 | /** @internal */ |
| 51 | export 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 */ |
| 79 | export const mapInput = dual< |
no test coverage detected