Skip to content
This repository has been archived by the owner on Jul 16, 2024. It is now read-only.

Commit

Permalink
fix examples typechecking (#108)
Browse files Browse the repository at this point in the history
  • Loading branch information
fubhy authored Dec 21, 2023
1 parent 2cc199a commit 7db84c3
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 3 deletions.
5 changes: 2 additions & 3 deletions examples/metrics.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import * as NodeSdk from "@effect/opentelemetry/NodeSdk"
import { PrometheusExporter } from "@opentelemetry/exporter-prometheus"
import * as Chunk from "effect/Chunk"
import { millis, seconds } from "effect/Duration"
import * as Effect from "effect/Effect"
import { pipe } from "effect/Function"
Expand Down Expand Up @@ -45,7 +44,7 @@ const summary = Metric.summary({
maxAge: "1 days",
maxSize: 1000,
error: 0.01,
quantiles: Chunk.make(0.1, 0.5, 0.9)
quantiles: [0.1, 0.5, 0.9]
})

const summaryLoop = Effect.randomWith((_) => _.nextRange(100, 1000)).pipe(
Expand All @@ -56,7 +55,7 @@ const summaryLoop = Effect.randomWith((_) => _.nextRange(100, 1000)).pipe(

const spawner = Effect.randomWith((_) => _.nextIntBetween(500, 1500)).pipe(
Effect.flatMap((_) => Effect.fork(Effect.sleep(_))),
Effect.flatMap((_) => _.await()),
Effect.flatMap((_) => _.await),
Effect.forever
)

Expand Down
14 changes: 14 additions & 0 deletions tsconfig.examples.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"extends": "./tsconfig.base.json",
"include": ["examples"],
"references": [
{
"path": "./tsconfig.src.json"
}
],
"compilerOptions": {
"tsBuildInfoFile": ".tsbuildinfo/examples.tsbuildinfo",
"rootDir": "examples",
"noEmit": true
}
}
3 changes: 3 additions & 0 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@
},
{
"path": "./tsconfig.test.json"
},
{
"path": "./tsconfig.examples.json"
}
]
}

0 comments on commit 7db84c3

Please sign in to comment.