From a1f38446b9eb1b7d298deda503b4e67a365a5ab2 Mon Sep 17 00:00:00 2001 From: Giulio Canti Date: Fri, 13 Sep 2024 11:05:21 +0200 Subject: [PATCH] chore: use Option.isNone in examples/http-server --- .vscode/settings.json | 3 ++- examples/http-server/src/Tracing.ts | 6 +++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/.vscode/settings.json b/.vscode/settings.json index 59f05cb..8c56b14 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,5 +1,6 @@ { "typescript.tsdk": "node_modules/typescript/lib", - "editor.defaultFormatter": "esbenp.prettier-vscode", + "editor.defaultFormatter": "dbaeumer.vscode-eslint", "editor.formatOnSave": true, + "eslint.format.enable": true } diff --git a/examples/http-server/src/Tracing.ts b/examples/http-server/src/Tracing.ts index 7813ad3..c7bb0e8 100644 --- a/examples/http-server/src/Tracing.ts +++ b/examples/http-server/src/Tracing.ts @@ -1,7 +1,7 @@ import * as NodeSdk from "@effect/opentelemetry/NodeSdk" import { OTLPTraceExporter } from "@opentelemetry/exporter-trace-otlp-http" import { BatchSpanProcessor } from "@opentelemetry/sdk-trace-base" -import { Config, Effect, Layer, Redacted } from "effect" +import { Config, Effect, Layer, Option, Redacted } from "effect" export const TracingLive = Layer.unwrapEffect( Effect.gen(function*() { @@ -10,11 +10,11 @@ export const TracingLive = Layer.unwrapEffect( Config.string("HONEYCOMB_DATASET"), "stremio-effect" ) - if (apiKey._tag === "None") { + if (Option.isNone(apiKey)) { const endpoint = yield* Config.option( Config.string("OTEL_EXPORTER_OTLP_ENDPOINT") ) - if (endpoint._tag === "None") { + if (Option.isNone(endpoint)) { return Layer.empty } return NodeSdk.layer(() => ({