Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
export function* unaryChan EventChannel>(
func: F,
...args: Parameters
) {
const chan = yield* call(func, ...args)
const reply = (yield* take(chan)) as EventChannelOutput>
chan.close()
return reply
}