@frontside/continuation
TypeScript icon, indicating that this package has built-in type declarations

0.1.6 • Public • Published

Continuation

Delimited continuations for JavaScript

Install

Synopsis

//deno
import { evaluate } from "https://deno.land/x/continuation/mod.ts";
//npm
import { evaluate } from "@frontside/continuation";

evaluate(function* () {
  for (let i = 5; i > 0; i--) {
    console.log(`${i}...`);
    yield* shift(function* (resume) {
      setTimeout(resume, 1000);
    });
  }
  console.log("blast off!");
});

prints:

5...
4...
3...
2...
1...
blast off!

Readme

Keywords

none

Package Sidebar

Install

npm i @frontside/continuation

Weekly Downloads

1

Version

0.1.6

License

MIT

Unpacked Size

23.6 kB

Total Files

10

Last publish

Collaborators

  • frontsidejack