Questions tagged [lazy.js]

Lazy.js is a functional utility library for JavaScript, similar to Underscore and Lo-Dash.

Lazy.js is a functional utility library for JavaScript, similar to Underscore and Lo-Dash, but with an underlying engine that supports many more use cases than those libraries, while offering comparable or superior performance in most scenarios.

Current Version: 0.4.0

Getting Started:

Intrigued? Great! Lazy.js has no external dependencies, so you can get started right away with:

<script type="text/javascript" src="lazy.js"></script>

<!-- optional: if you want support for DOM event and AJAX-based sequences: -->
<script type="text/javascript" src="lazy.browser.js"></script>

Or, if you're using Node.js:

npm install lazy.js

Useful Links:

You can also create an issue on GitHub if you have any issues with the library. I work through them eventually.

4 questions
34
votes
1 answer

Do Immutable.js or Lazy.js perform short-cut fusion?

First, let me define what is short-cut fusion for those of you who don't know. Consider the following array transformation in JavaScript: var a = [1,2,3,4,5].map(square).map(increment); console.log(a); function square(x) { return x *…
Aadit M Shah
  • 72,912
  • 30
  • 168
  • 299
3
votes
1 answer

How to chain multiple filters in lazy.js in a loop (from array)

I have an array that contain filter functions that need to be applied to an array of items in Lazy.js. I've tried using a for-loop but only the last filter is applied. function (searchText) { var result = Lazy(input); for (var query of…
A. Li
  • 33
  • 8
0
votes
3 answers

CSV format to object array with running total

EDIT: How do I go from this : tickets = [ { date: "Jan 05,2016", time: "08:19 AM", name: "Bernie Sanders" }, { date: "Jan 05,2016", time: "09:29 AM", name: "Donald Trump" }, { date: "Jan 05,2016", time: "09:31 AM", name: "Donald Trump" }, {…
Bum Son
  • 89
  • 1
  • 7
0
votes
1 answer

Lazy.js: zipping with a range

I'd like to zip together a count with an array. It seems something like this would be the most elegant way of doing it Lazy([...]).zip(Lazy.range(1, Infinity)). But it doesn't produce the result I expect. Here is a unit test: var assert =…
Jon Tirsen
  • 4,750
  • 4
  • 29
  • 27