function useScope
thefrontside/effectionGet the scope of the currently running Operation.
Examples
Example 1
import { sleep, useScope } from "effection";
let scope = yield* useScope();
let task = yield* scope.spawn(function* () {
yield* sleep(100);
return "done";
});
// task is attached to the current scope and cannot outlive it
console.log(yield* task);
Return Type
an operation yielding the current scope