clio-lazy

1.0.0 • Public • Published

clio-lazy

Lazy evaluation for Clio and JS

Usage in Clio

In Clio all functions are lazy by default.

Usage in JavaScript

You need to use lazy to wrap your functions:

const lazy = require("clio-lazy");
const lazyAdd = lazy((a, b) => a + b);
const myLazyNumber = lazyAdd(2, 3);
// ^ this will be evaluated only when the value is needed!
// for example if we do:
console.log(myLazyNumber);
// or if we do:
const notLazy = myLazyNumber + 2;

Readme

Keywords

Package Sidebar

Install

npm i clio-lazy

Weekly Downloads

0

Version

1.0.0

License

Apache-2.0

Unpacked Size

3.5 kB

Total Files

4

Last publish

Collaborators

  • pouya-eghbali