Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/eeue56/ts-list-zipper


https://github.com/eeue56/ts-list-zipper

Last synced: about 1 month ago
JSON representation

Awesome Lists containing this project

README

        

# ts-list-zipper

A zipper for use with arrays in TS.

```javascript

import { Zipper } from "Zipper"

let zipper = Zipper.fromCons(1, [2, 3]);

console.log(zipper.current()); // 1

zipper.next();
console.log(zipper.current()); // 2

zipper.next();
console.log(zipper.current()); // 3

zipper.next();
console.log(zipper.current()); // 3

zipper.first();
console.log(zipper.current()); // 1

```