|Written by Nikos Vaggalis|
|Tuesday, 25 February 2020|
The problems with the iteration methods that needed fixing were mainly that:
they are eager,meaning that the set undergoing intermittent transformations is the full one,even when only a few items are needed from it:
"Every time you filter or you map something you create a new array".
LinQer introduces a class called Enumerable, just like its .NET counterpart, which wraps any iterable structure, for example generators and not just arrays, providing the means to work with them under the same interface that .NET's Enumerable supports. For example,a pretty valid operation to an Enumerable instance is the following :
Written in Typescript,under the hood, LinQer uses generators and with that lazy evaluation. Therefore we now we can limit the operations to just the items of the collection under transformation that are of interest.
LinQer is split in two parts, Linqer.slim.js and Linqer.js. The former exposes the basic methods while the latter all (well most) of the original .NET Enumerable methods including those of Slim, hence you get to choose the one suited to the circumstance at hand. For the full reference of the supported methods head over to its Github repo.
Aside from the repo, the author now offers the library as an npm package making its instalation as simple as:
|Last Updated ( Tuesday, 25 February 2020 )|