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
}
export function* typedCall any>(func: F, ...args: Parameters) {
const ret = (yield call(func, ...args)) as ReturnType
return ret
}