Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/champii/infinitelist
Infinite Sequence List in Javascript
https://github.com/champii/infinitelist
Last synced: 4 days ago
JSON representation
Infinite Sequence List in Javascript
- Host: GitHub
- URL: https://github.com/champii/infinitelist
- Owner: Champii
- License: gpl-2.0
- Created: 2015-09-10T18:18:37.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2015-09-10T19:03:25.000Z (over 9 years ago)
- Last Synced: 2024-08-11T11:32:40.420Z (4 months ago)
- Language: LiveScript
- Size: 145 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# InfiniteList
Infinite Sequence List in JavascriptUnder developement
### /!\ This library use ES6 generators, your node binary must use --harmony flag /!\
# Usage
```livescript
List = require \infinitelistlist = new List 0 (+ 2)
console.log list.get 5 # 10
console.log list # [0, 2, 4, 6, 8, 10]
```# API
```livescript
new List(startValue, iterator)
```
Iterator is a function of the following form :```livescript
(prev, i) ->
```
With `prev` the last element in the list, and `i` the current generating index.