enga
v1.0.1
Published
Topple your call stack
Downloads
2
Readme
enga
Topple your call stack
Usage
import { Enga, EngaFunc, enga } from "enga";
import { AsyncEnga, AsyncEngaFunc, asyncEnga } from "enga/async";
import { Enga, enga } from "enga";
const countUp = (n: number): Enga<number> => enga(
() => n === 0 ? 0 : countUp(n - 1),
x => x + 1,
);
console.log(countUp(1000000).execute()) // 1000000