Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/effection/lib/mod.ts>lift

Structured concurrency and effects for JavaScript
Latest
function lift
Re-export
import { lift } from "https://deno.land/x/effection@4.0.0-alpha.1/lib/mod.ts";

Convert a simple function into an Operation

Examples

Example 1

let log = lift((message) => console.log(message));

export function* run() {
  yield* log("hello world");
  yield* log("done");
}

Type Parameters

TArgs extends unknown[]
TReturn

Parameters

fn: (...args: TArgs) => TReturn

Returns

(...args: TArgs) => Operation<TReturn>

a function returning an operation that invokes fn when evaluated