Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/vanruesc/iterator-result
A base class for iterator results.
https://github.com/vanruesc/iterator-result
done iterator next protocol result value
Last synced: 4 months ago
JSON representation
A base class for iterator results.
- Host: GitHub
- URL: https://github.com/vanruesc/iterator-result
- Owner: vanruesc
- License: zlib
- Archived: true
- Created: 2017-01-11T19:02:51.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2023-07-20T20:02:59.000Z (over 1 year ago)
- Last Synced: 2024-09-27T18:15:48.381Z (4 months ago)
- Topics: done, iterator, next, protocol, result, value
- Language: JavaScript
- Homepage:
- Size: 148 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# Iterator Result
[![Build status](https://travis-ci.org/vanruesc/iterator-result.svg?branch=master)](https://travis-ci.org/vanruesc/iterator-result)
[![NPM version](https://badge.fury.io/js/iterator-result.svg)](http://badge.fury.io/js/iterator-result)
[![Dependencies](https://david-dm.org/vanruesc/iterator-result.svg?branch=master)](https://david-dm.org/vanruesc/iterator-result)The [iterator protocol](https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Iteration_protocols) defines a standard
way to produce a sequence of values. An object is an iterator when it implements a `next()` method which returns objects
that have at least the two properties `value` and `done`. This module provides a base class for such iterator results.*[API Reference](https://vanruesc.github.io/iterator-result)*
## Installation
```sh
npm install iterator-result
```## Usage
```javascript
import IteratorResult from "iterator-result";export class InfiniteIterator {
constructor() {
this.result = new IteratorResult();
}
next() {
return this.result;
}
}
```
## Contributing
Maintain the existing coding style. Add unit tests for any new or changed functionality. Lint and test your code.