import { type Env } from "https://deno.land/x/hyogwa@v0.1.0-rc.4/src/env.ts";
Effect spec template for environment setting referencing effects (a.k.a. 'Reader')
Examples
Reading userAgent
Reading userAgent
import { Effect, createPrimitives, Effectful } from 'hyogwa/core'
import { Env } from 'hyogwa/env'
import { unsafeRunSync } from 'hyogwa/runners'
type UA = Effect<'UA', Env<string>>
const UA = createPrimitives<UA>('UA')
function* main(): Effectful<UA, string> {
return yield* UA.env
}
unsafeRunSync(main(), {
UA: {
env: navigator.userAgent
}
})
Properties
env: T