swiftengineer / elm-data / ElmData.Resource
Resource allows you to make requests on behalf of a DAO, without having to think about the state of the DAO


type alias Resource recordType externalMsg =
{ create : ElmData.Session.Session -> recordType -> Platform.Cmd.Cmd externalMsg
, fetch : ElmData.Session.Session -> String -> Platform.Cmd.Cmd externalMsg
, update : ElmData.Session.Session -> recordType -> Platform.Cmd.Cmd externalMsg 
}

A Resource


type ResourceMsg recordType
    = Success recordType
    | Failure ElmData.Messages.RequestError

A Resource Message

resource : ElmData.DAO.DAO recordType -> (ResourceMsg recordType -> localMsg) -> (localMsg -> externalMsg) -> Resource recordType externalMsg

Creator for a Resource