glasserc/elm-requested - version: 1.0.0

for more information visit the package's GitHub page

Package contains the following modules:

elm-requested: an opinionated library for managing requests

This library introduces a type called Requested which is designed for managing the state of asynchronous, fallible operations, especially those which can be performed several times. A Requested t e a represents a successful a, a failed e, or an outstanding request (identified by t) which we expect to eventually resolve into a success or failure.

A good use case for Requested is something like Gmail's main view. This view shows a bunch of email threads which are fetched from a remote service. The view can show email threads from your "inbox" as well as for different "labels". The user can easily switch from label to label or label to inbox; when this happens, data is requested from the remote service, and it can take a variable amount of time to respond. Using Requested helps you ensure that:

For an example of this paradigm, check the examples directory.

This sounds like RemoteData

Requested is inspired by RemoteData, but with some differences:

If you need the additional state of "not requested", this can be easily modeled using a Maybe. See Requested.Maybe for utilities to make this easier.