Skip to content

Instantly share code, notes, and snippets.

@mostalive
Last active May 22, 2017 13:24
Show Gist options
  • Save mostalive/0c3b53a411dbf0eb78cd309b128fed94 to your computer and use it in GitHub Desktop.
Save mostalive/0c3b53a411dbf0eb78cd309b128fed94 to your computer and use it in GitHub Desktop.
Loadable state of an object in my pux application (under construction - sketch)
-- Loadable
-- Thanks to @karls - full implementation would probably be... https://github.com/krisajenkins/purescript-remotedata/blob/v2.1.0/src/Network/RemoteData.purs#L30-L34
-- i stands for identifier, e.g. a schema or a number, or whatever else is needed to load or index it
-- kind of a 'maybe'.
-- o is for object. Only in the Loaded state is the object available
-- example ```
-- showLoaded Loaded id object = show object
-- showLoaded _ = "Object not loaded"
-- ```
data Loadable i o = NotLoading | Loading i | Loaded i o | NotFound i | NotAuthorized i
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment