This is an alternative site for discovering Elm packages. You may be looking for the official Elm package site instead.
A List that automatically slides
version 3.0.0
license MIT
native-modules False
elm-version 0.18.0 <= v < 0.19.0
Tag 3.0.0
Committed At 2018-07-27 11:37:02 UTC
elm-lang/core 5.1.1 <= v < 6.0.0 5.1.1

Modules

README

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 🙂