fdbeirao / elm-sliding-list

An Elm list that slides automatically

Home Page:http://package.elm-lang.org/packages/fdbeirao/elm-sliding-list/latest

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

elm-sliding-list

Build Status

This package gives you a sliding list. You can specify that you wish to have a list that will have at most n items. For instance, maybe you want a list that can have at most 3 items. The moment you add a 4th item to this list, the oldest item will be dropped, thus ensuring you will only have a maximum of 3 items.

The maximum number of items in a list must be greater than zero. If you specify a number smaller than 1 for the new, fromList or resize functions, the sliding list will default to a size of 1.

Feel free to take a look into the tests, to get a better understanding of this module.

This package only supports inserting items into the sliding list from one direction (right to left). If you wish for more flexibility, you can also check the Bounded Double-ended queue package (not owned by the author of this package).

Feedback is always greatly appreciated 🙂

About

An Elm list that slides automatically

http://package.elm-lang.org/packages/fdbeirao/elm-sliding-list/latest

License:MIT License


Languages

Language:Elm 100.0%