Module
Specular.FRP.Async
- Package
- purescript-specular
- Repository
- restaumatic/purescript-specular
#RequestState Source
data RequestState a
Constructors
Instances
(Eq a) => Eq (RequestState a)
Generic (RequestState a) _
Functor RequestState
(Show a) => Show (RequestState a)
#fromLoaded Source
fromLoaded :: forall a. RequestState a -> Maybe a
#asyncRequestMaybe Source
asyncRequestMaybe :: forall m a. MonadEffect m => MonadFRP m => Dynamic (Maybe (Aff a)) -> m (Dynamic (RequestState a))
On each observed value of the Dynamic,
if it's Nothing, the resulting Dynamic will have value NotRequested.
if it's a Just, the contents will be executes asynchronously and the resulting Dynamic will obtain value Loaded x. During the request execution the result Dynamic will have value Loading.
If the input Dynamic changes value while a request is in progress, it will be cancelled using Aff's (Aff's) cancellation mechanism. This ensures that the value of the resulting Dynamic will eventually be that of the most recent value of the input Dynamic, independent of the order of arrival of the responses.
#asyncRequest Source
asyncRequest :: forall m a. MonadEffect m => MonadFRP m => Dynamic (Aff a) -> m (Dynamic (RequestState a))
Like asyncRequestMaybe
, but without the Nothing case.
- Modules
- Control.
Monad. Cleanup - Control.
Monad. Replace - Specular.
Debug - Specular.
Dom. Browser - Specular.
Dom. Builder - Specular.
Dom. Builder. Class - Specular.
Dom. Element - Specular.
Dom. Element. Class - Specular.
Dom. Node. Class - Specular.
Dom. Widget - Specular.
Dom. Widgets. Button - Specular.
Dom. Widgets. Input - Specular.
Dom. Widgets. RadioGroup - Specular.
Dom. Widgets. Select - Specular.
FRP - Specular.
FRP. Async - Specular.
FRP. Base - Specular.
FRP. Fix - Specular.
FRP. List - Specular.
FRP. Replaceable - Specular.
FRP. WeakDynamic - Specular.
Internal. Effect - Specular.
Internal. Incremental - Specular.
Internal. Incremental. Array - Specular.
Internal. Incremental. Effect - Specular.
Internal. Incremental. Global - Specular.
Internal. Incremental. Mutable - Specular.
Internal. Incremental. MutableArray - Specular.
Internal. Incremental. Node - Specular.
Internal. Incremental. Optional - Specular.
Internal. Incremental. PriorityQueue - Specular.
Internal. Incremental. Ref - Specular.
Internal. Profiling - Specular.
Internal. Queue - Specular.
Internal. RIO - Specular.
Profiling - Specular.
Ref