PaackEng / paack-remotedata / Remote.Dict.Recyclable

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

Building

update : comparable -> (Remote.Recyclable.Recyclable a b c -> Remote.Recyclable.Recyclable a b c) -> Dict comparable (Remote.Recyclable.Recyclable a b c) -> Dict comparable (Remote.Recyclable.Recyclable a b c)

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

mergeResponse : comparable -> Remote.Response.Response a b c -> Dict comparable (Remote.Recyclable.Recyclable a b c) -> Dict comparable (Remote.Recyclable.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.

toLoading : comparable -> Dict comparable (Remote.Recyclable.Recyclable a b c) -> Dict comparable (Remote.Recyclable.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 (Remote.Recyclable.Recyclable a b c) -> Remote.Recyclable.Recyclable a b c

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