Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/maorleger/elm-infinite-zipper
https://github.com/maorleger/elm-infinite-zipper
elm zipper
Last synced: 8 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/maorleger/elm-infinite-zipper
- Owner: maorleger
- License: mit
- Created: 2017-03-04T22:09:26.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2017-04-30T17:52:44.000Z (over 7 years ago)
- Last Synced: 2024-12-09T18:01:19.467Z (15 days ago)
- Topics: elm, zipper
- Language: Elm
- Size: 6.84 KB
- Stars: 3
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# elm-infinite-zipper
An infinite zipper list that will always focus on an element. Once a zipper is initialized, you can move backwards and forwards and the zipper will circle around once it passes an end focus.
When the cursor is at the end of the list, right will return focus to the front of the list.
When the cursor is at the beginning of the list, previous will return focus to the end of the list.## As an example:
```
InfiniteZipper.fromListWithDefault 4 [1, 2, 3]
|> InfiniteZipper.next
|> InfiniteZipper.next
|> InfiniteZipper.next
|> InfiniteZipper.current
-- 1
```