PaackEng/paack-remotedata/1.1.0

Remote.Dict.Recyclable

This module is composed of helper functions for handling Recyclables inside [Elm's Dict][elm-dict].

Building

comparable
-> (Recyclable a b c -> Recyclable a b c)
-> Dict comparable (Recyclable a b c)
-> Dict comparable (Recyclable a b c)

Similar to Dict.update, but using NeverAsked for not-found keys and also for dropping updated values.

comparable
-> Response a b c
-> Dict comparable (Recyclable a b c)
-> Dict comparable (Recyclable a b c)

Shortcut for merging a new freshily-fetched response to the current state.

See [Recyclable.mergeResponse]((Remote-Recyclable#mergeResponse) for the operation description.

comparable
-> Dict comparable (Recyclable a b c)
-> Dict comparable (Recyclable a b c)

Shortcut for updating one value back to its loading state.

See [Recyclable.toLoading]((Remote-Recyclable#toLoading) for the operation description.

Query

get :
comparable
-> Dict comparable (Recyclable a b c)
-> Recyclable a b c

Reduce the result of a Dict.get operation by transforming Nothing in NeverAsked.