Skip to content

Commit

Permalink
update effect (#119)
Browse files Browse the repository at this point in the history
  • Loading branch information
tim-smart authored Dec 11, 2023
1 parent 4333fd0 commit 61458dd
Show file tree
Hide file tree
Showing 4 changed files with 72 additions and 74 deletions.
14 changes: 7 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,21 +17,21 @@
"license": "ISC",
"devDependencies": {
"@octokit/types": "^12.4.0",
"@types/node": "^20.10.3",
"@types/node": "^20.10.4",
"tsc-watch": "^6.0.4",
"typescript": "^5.3.2"
"typescript": "^5.3.3"
},
"dependencies": {
"@effect/platform-node": "^0.34.0",
"@effect/schema": "^0.52.0",
"@effect/platform-node": "^0.35.0",
"@effect/schema": "^0.53.0",
"cron-parser": "^4.9.0",
"dfx": "^0.79.0",
"dfx": "^0.80.0",
"dotenv": "^16.3.1",
"effect": "2.0.0-next.59",
"effect": "2.0.0-next.60",
"gpt-tokenizer": "^2.1.2",
"html-entities": "^2.4.0",
"octokit": "^3.1.2",
"openai": "^4.20.1",
"prettier": "^3.1.0"
"prettier": "^3.1.1"
}
}
124 changes: 62 additions & 62 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 1 addition & 3 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,7 @@ const DiscordConfigLive = DiscordConfig.layerConfig({

const LogLevelLive = Layer.unwrapEffect(
Effect.gen(function* (_) {
const debug = yield* _(
Effect.config(Config.withDefault(Config.boolean("DEBUG"), false)),
)
const debug = yield* _(Config.withDefault(Config.boolean("DEBUG"), false))
const level = debug ? LogLevel.All : LogLevel.Info
return Logger.minimumLogLevel(level)
}),
Expand Down
4 changes: 2 additions & 2 deletions src/utils/Layer.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Config, Context, Effect, Layer } from "effect"
import { Config, Context, Layer } from "effect"

export const config =
<I, A>(tag: Context.Tag<I, A>) =>
(config: Config.Config.Wrap<A>) =>
Layer.effect(tag, Effect.config(Config.unwrap(config)))
Layer.effect(tag, Config.unwrap(config))

0 comments on commit 61458dd

Please sign in to comment.