affex
v0.12.0
Published
[](LICENSE.md) [](https://github.com/xzhayon/affex/actions) [: void
}
// Create service tag.
const tag = fx.tag<Log>()
// Derive effect constructor.
const log = fx.operation(tag)
// Perform effect in generator function.
function* main() {
yield* log('hello, world')
}
// Create layer with effect handler.
function ConsoleLog() {
return fx.layer(tag, (message) => console.log(message))
}
// Run program with provided context.
fx.runPromise(main, fx.context().with(ConsoleLog()))