driebit/elm-ginger/2.2.0

NOTE: the latest version is 5.0.1

Ginger.Id

The Ginger resource id. We 'tag' the resource id with type Int using elm-tagged. This helps us to not mix up some other Int with a resource id by accident.

The only way to construct a ResourceId is by decoding one from some json or parsing it out of an url path. This is rather strict and there might be some times you just need to create a random ResourceId for whatever reason, this hasn't come up so far, but file an issue if it does.

Definition

type alias ResourceId =
Tagged Resource Int

Convert

toInt : ResourceId -> Int
toString : ResourceId -> String

Decode

fromUrl : Parser (ResourceId -> a) a
fromJson : Decoder ResourceId