Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/eeue56/ts-list-zipper
https://github.com/eeue56/ts-list-zipper
Last synced: about 1 month ago
JSON representation
- Host: GitHub
- URL: https://github.com/eeue56/ts-list-zipper
- Owner: eeue56
- License: bsd-3-clause
- Created: 2017-11-13T23:12:29.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2017-11-13T23:56:44.000Z (about 7 years ago)
- Last Synced: 2024-05-21T12:33:42.583Z (8 months ago)
- Language: TypeScript
- Size: 6.84 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
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()); // 2zipper.next();
console.log(zipper.current()); // 3zipper.next();
console.log(zipper.current()); // 3zipper.first();
console.log(zipper.current()); // 1```