Skip to content

resinfo/rescript-js-iterator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Rescript JS Iterator

Rescript JS Iterator is a ReScript library that provides bindings to the JavaScript iterator protocol.

Installation

Using yarn or npm:

yarn add rescript-js-iterator
npm install --save rescript-js-iterator

In your bsconfig.json, add:

{
  "bs-dependencies": ["rescript-js-iterator"]
}

Usage

module Iterator = Js_iterator

let myIterable = getIterator() // previously defined function.

let current = myIterable->Iterator.next

let isDone = current->Iterator.done
let value = current->Iterator.value

/*
 * `done` and `value` are also available as properties of the object itself.
 */
current.done == current->Iterator.done
current.value == current->Iterator.value

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Please make sure to update tests as appropriate.

License

MIT

About

ReScript bindings to the JavaScript iterator protocol

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published