reflex-dom-core-0.6.0.0: Functional Reactive Web Apps with Reflex
Safe HaskellNone
LanguageHaskell98

Reflex.Dom.Builder.Immediate

Description

This is a builder to be used on the client side. It can be run in two modes:

  1. in "hydration mode", reusing DOM nodes already in the page (as produced by renderStatic)
  2. in "immediate mode", creating and appending DOM nodes as required

In "hydration mode", the preexisting DOM must contain what the builder will expect at switchover time (the time at which parity with the static renderer is reached, and the time after which the page is "live").

For example, displaying the current time as text should be done inside prerender to ensure that we don't attempt to hydrate the incorrect text. The server will prerender a text node with time A, and the client will expect a text node with time B. Barring a miracle, time A and time B will not match, and hydration will fail.

Synopsis

Documentation

newtype HydrationDomBuilderT s t m a Source #

A monad for DomBuilder which just gets the results of children and pushes work into an action that is delayed until after postBuild (to match the static builder). The action runs in HydrationRunnerT, which performs the DOM takeover and sets up the events, after which point this monad will continue in the vein of ImmediateDomBuilderT.

Constructors

HydrationDomBuilderT 

Fields

Instances

Instances details
(Adjustable t m, PrerenderBaseConstraints js t m, ReflexHost t) => Prerender js t (HydrationDomBuilderT HydrationDomSpace t m) Source # 
Instance details

Defined in Reflex.Dom.Prerender

Associated Types

type Client (HydrationDomBuilderT HydrationDomSpace t m) :: Type -> Type Source #

(ReflexHost t, Adjustable t m, PrerenderBaseConstraints js t m) => Prerender js t (HydrationDomBuilderT GhcjsDomSpace t m) Source # 
Instance details

Defined in Reflex.Dom.Prerender

Associated Types

type Client (HydrationDomBuilderT GhcjsDomSpace t m) :: Type -> Type Source #

SupportsHydrationDomBuilder t m => NotReady t (HydrationDomBuilderT s t m) Source # 
Instance details

Defined in Reflex.Dom.Builder.Immediate

PerformEvent t m => PerformEvent t (HydrationDomBuilderT s t m) Source # 
Instance details

Defined in Reflex.Dom.Builder.Immediate

Associated Types

type Performable (HydrationDomBuilderT s t m) :: Type -> Type #

(Monad m, MonadRef m, Ref m ~ Ref IO, MonadReflexCreateTrigger t m) => TriggerEvent t (HydrationDomBuilderT s t m) Source # 
Instance details

Defined in Reflex.Dom.Builder.Immediate

Methods

newTriggerEvent :: HydrationDomBuilderT s t m (Event t a, a -> IO ()) #

newTriggerEventWithOnComplete :: HydrationDomBuilderT s t m (Event t a, a -> IO () -> IO ()) #

newEventWithLazyTriggerWithOnComplete :: ((a -> IO () -> IO ()) -> IO (IO ())) -> HydrationDomBuilderT s t m (Event t a) #

PostBuild t m => PostBuild t (HydrationDomBuilderT s t m) Source # 
Instance details

Defined in Reflex.Dom.Builder.Immediate

Methods

getPostBuild :: HydrationDomBuilderT s t m (Event t ()) #

MonadReflexCreateTrigger t m => MonadReflexCreateTrigger t (HydrationDomBuilderT s t m) Source # 
Instance details

Defined in Reflex.Dom.Builder.Immediate

Methods

newEventWithTrigger :: (EventTrigger t a -> IO (IO ())) -> HydrationDomBuilderT s t m (Event t a) #

newFanEventWithTrigger :: GCompare k => (forall a. k a -> EventTrigger t a -> IO (IO ())) -> HydrationDomBuilderT s t m (EventSelector t k) #

(Adjustable t m, MonadJSM m, MonadHold t m, MonadFix m, PrimMonad m, RawDocument (DomBuilderSpace (HydrationDomBuilderT s t m)) ~ Document) => Adjustable t (HydrationDomBuilderT s t m) Source # 
Instance details

Defined in Reflex.Dom.Builder.Immediate

Methods

runWithReplace :: HydrationDomBuilderT s t m a -> Event t (HydrationDomBuilderT s t m b) -> HydrationDomBuilderT s t m (a, Event t b) #

traverseIntMapWithKeyWithAdjust :: (Key -> v -> HydrationDomBuilderT s t m v') -> IntMap v -> Event t (PatchIntMap v) -> HydrationDomBuilderT s t m (IntMap v', Event t (PatchIntMap v')) #

traverseDMapWithKeyWithAdjust :: GCompare k => (forall a. k a -> v a -> HydrationDomBuilderT s t m (v' a)) -> DMap k v -> Event t (PatchDMap k v) -> HydrationDomBuilderT s t m (DMap k v', Event t (PatchDMap k v')) #

traverseDMapWithKeyWithAdjustWithMove :: GCompare k => (forall a. k a -> v a -> HydrationDomBuilderT s t m (v' a)) -> DMap k v -> Event t (PatchDMapWithMove k v) -> HydrationDomBuilderT s t m (DMap k v', Event t (PatchDMapWithMove k v')) #

(HasJS x m, ReflexHost t) => HasJS x (HydrationDomBuilderT s t m) Source # 
Instance details

Defined in Reflex.Dom.Builder.Immediate

Associated Types

type JSX (HydrationDomBuilderT s t m) :: Type -> Type Source #

SupportsHydrationDomBuilder t m => MountableDomBuilder t (HydrationDomBuilderT GhcjsDomSpace t m) Source # 
Instance details

Defined in Reflex.Dom.Builder.Immediate

SupportsHydrationDomBuilder t m => DomBuilder t (HydrationDomBuilderT GhcjsDomSpace t m) Source # 
Instance details

Defined in Reflex.Dom.Builder.Immediate

Methods

textNode :: TextNodeConfig t -> HydrationDomBuilderT GhcjsDomSpace t m (TextNode (DomBuilderSpace (HydrationDomBuilderT GhcjsDomSpace t m)) t) Source #

commentNode :: CommentNodeConfig t -> HydrationDomBuilderT GhcjsDomSpace t m (CommentNode (DomBuilderSpace (HydrationDomBuilderT GhcjsDomSpace t m)) t) Source #

element :: forall (er :: EventTag -> Type) a. Text -> ElementConfig er t (DomBuilderSpace (HydrationDomBuilderT GhcjsDomSpace t m)) -> HydrationDomBuilderT GhcjsDomSpace t m a -> HydrationDomBuilderT GhcjsDomSpace t m (Element er (DomBuilderSpace (HydrationDomBuilderT GhcjsDomSpace t m)) t, a) Source #

inputElement :: forall (er :: EventTag -> Type). InputElementConfig er t (DomBuilderSpace (HydrationDomBuilderT GhcjsDomSpace t m)) -> HydrationDomBuilderT GhcjsDomSpace t m (InputElement er (DomBuilderSpace (HydrationDomBuilderT GhcjsDomSpace t m)) t) Source #

textAreaElement :: forall (er :: EventTag -> Type). TextAreaElementConfig er t (DomBuilderSpace (HydrationDomBuilderT GhcjsDomSpace t m)) -> HydrationDomBuilderT GhcjsDomSpace t m (TextAreaElement er (DomBuilderSpace (HydrationDomBuilderT GhcjsDomSpace t m)) t) Source #

selectElement :: forall (er :: EventTag -> Type) a. SelectElementConfig er t (DomBuilderSpace (HydrationDomBuilderT GhcjsDomSpace t m)) -> HydrationDomBuilderT GhcjsDomSpace t m a -> HydrationDomBuilderT GhcjsDomSpace t m (SelectElement er (DomBuilderSpace (HydrationDomBuilderT GhcjsDomSpace t m)) t, a) Source #

placeRawElement :: RawElement (DomBuilderSpace (HydrationDomBuilderT GhcjsDomSpace t m)) -> HydrationDomBuilderT GhcjsDomSpace t m () Source #

wrapRawElement :: forall (er :: EventTag -> Type). RawElement (DomBuilderSpace (HydrationDomBuilderT GhcjsDomSpace t m)) -> RawElementConfig er t (DomBuilderSpace (HydrationDomBuilderT GhcjsDomSpace t m)) -> HydrationDomBuilderT GhcjsDomSpace t m (Element er (DomBuilderSpace (HydrationDomBuilderT GhcjsDomSpace t m)) t) Source #

SupportsHydrationDomBuilder t m => DomBuilder t (HydrationDomBuilderT HydrationDomSpace t m) Source # 
Instance details

Defined in Reflex.Dom.Builder.Immediate

Methods

textNode :: TextNodeConfig t -> HydrationDomBuilderT HydrationDomSpace t m (TextNode (DomBuilderSpace (HydrationDomBuilderT HydrationDomSpace t m)) t) Source #

commentNode :: CommentNodeConfig t -> HydrationDomBuilderT HydrationDomSpace t m (CommentNode (DomBuilderSpace (HydrationDomBuilderT HydrationDomSpace t m)) t) Source #

element :: forall (er :: EventTag -> Type) a. Text -> ElementConfig er t (DomBuilderSpace (HydrationDomBuilderT HydrationDomSpace t m)) -> HydrationDomBuilderT HydrationDomSpace t m a -> HydrationDomBuilderT HydrationDomSpace t m (Element er (DomBuilderSpace (HydrationDomBuilderT HydrationDomSpace t m)) t, a) Source #

inputElement :: forall (er :: EventTag -> Type). InputElementConfig er t (DomBuilderSpace (HydrationDomBuilderT HydrationDomSpace t m)) -> HydrationDomBuilderT HydrationDomSpace t m (InputElement er (DomBuilderSpace (HydrationDomBuilderT HydrationDomSpace t m)) t) Source #

textAreaElement :: forall (er :: EventTag -> Type). TextAreaElementConfig er t (DomBuilderSpace (HydrationDomBuilderT HydrationDomSpace t m)) -> HydrationDomBuilderT HydrationDomSpace t m (TextAreaElement er (DomBuilderSpace (HydrationDomBuilderT HydrationDomSpace t m)) t) Source #

selectElement :: forall (er :: EventTag -> Type) a. SelectElementConfig er t (DomBuilderSpace (HydrationDomBuilderT HydrationDomSpace t m)) -> HydrationDomBuilderT HydrationDomSpace t m a -> HydrationDomBuilderT HydrationDomSpace t m (SelectElement er (DomBuilderSpace (HydrationDomBuilderT HydrationDomSpace t m)) t, a) Source #

placeRawElement :: RawElement (DomBuilderSpace (HydrationDomBuilderT HydrationDomSpace t m)) -> HydrationDomBuilderT HydrationDomSpace t m () Source #

wrapRawElement :: forall (er :: EventTag -> Type). RawElement (DomBuilderSpace (HydrationDomBuilderT HydrationDomSpace t m)) -> RawElementConfig er t (DomBuilderSpace (HydrationDomBuilderT HydrationDomSpace t m)) -> HydrationDomBuilderT HydrationDomSpace t m (Element er (DomBuilderSpace (HydrationDomBuilderT HydrationDomSpace t m)) t) Source #

MonadSample t m => MonadSample (t :: Type) (HydrationDomBuilderT s t m) Source # 
Instance details

Defined in Reflex.Dom.Builder.Immediate

Methods

sample :: Behavior t a -> HydrationDomBuilderT s t m a #

MonadHold t m => MonadHold (t :: Type) (HydrationDomBuilderT s t m) Source # 
Instance details

Defined in Reflex.Dom.Builder.Immediate

Methods

hold :: a -> Event t a -> HydrationDomBuilderT s t m (Behavior t a) #

holdDyn :: a -> Event t a -> HydrationDomBuilderT s t m (Dynamic t a) #

holdIncremental :: Patch p => PatchTarget p -> Event t p -> HydrationDomBuilderT s t m (Incremental t p) #

buildDynamic :: PushM t a -> Event t a -> HydrationDomBuilderT s t m (Dynamic t a) #

headE :: Event t a -> HydrationDomBuilderT s t m (Event t a) #

(Reflex t, MonadFix m) => DomRenderHook (t :: Type) (HydrationDomBuilderT s t m) Source # 
Instance details

Defined in Reflex.Dom.Builder.Immediate

MonadTrans (HydrationDomBuilderT s t) Source # 
Instance details

Defined in Reflex.Dom.Builder.Immediate

Methods

lift :: Monad m => m a -> HydrationDomBuilderT s t m a #

Monad m => Monad (HydrationDomBuilderT s t m) Source # 
Instance details

Defined in Reflex.Dom.Builder.Immediate

Methods

(>>=) :: HydrationDomBuilderT s t m a -> (a -> HydrationDomBuilderT s t m b) -> HydrationDomBuilderT s t m b #

(>>) :: HydrationDomBuilderT s t m a -> HydrationDomBuilderT s t m b -> HydrationDomBuilderT s t m b #

return :: a -> HydrationDomBuilderT s t m a #

Functor m => Functor (HydrationDomBuilderT s t m) Source # 
Instance details

Defined in Reflex.Dom.Builder.Immediate

Methods

fmap :: (a -> b) -> HydrationDomBuilderT s t m a -> HydrationDomBuilderT s t m b #

(<$) :: a -> HydrationDomBuilderT s t m b -> HydrationDomBuilderT s t m a #

MonadFix m => MonadFix (HydrationDomBuilderT s t m) Source # 
Instance details

Defined in Reflex.Dom.Builder.Immediate

Methods

mfix :: (a -> HydrationDomBuilderT s t m a) -> HydrationDomBuilderT s t m a #

Monad m => Applicative (HydrationDomBuilderT s t m) Source # 
Instance details

Defined in Reflex.Dom.Builder.Immediate

Methods

pure :: a -> HydrationDomBuilderT s t m a #

(<*>) :: HydrationDomBuilderT s t m (a -> b) -> HydrationDomBuilderT s t m a -> HydrationDomBuilderT s t m b #

liftA2 :: (a -> b -> c) -> HydrationDomBuilderT s t m a -> HydrationDomBuilderT s t m b -> HydrationDomBuilderT s t m c #

(*>) :: HydrationDomBuilderT s t m a -> HydrationDomBuilderT s t m b -> HydrationDomBuilderT s t m b #

(<*) :: HydrationDomBuilderT s t m a -> HydrationDomBuilderT s t m b -> HydrationDomBuilderT s t m a #

MonadIO m => MonadIO (HydrationDomBuilderT s t m) Source # 
Instance details

Defined in Reflex.Dom.Builder.Immediate

Methods

liftIO :: IO a -> HydrationDomBuilderT s t m a #

MonadException m => MonadException (HydrationDomBuilderT s t m) Source # 
Instance details

Defined in Reflex.Dom.Builder.Immediate

MonadAsyncException m => MonadAsyncException (HydrationDomBuilderT s t m) Source # 
Instance details

Defined in Reflex.Dom.Builder.Immediate

Methods

mask :: ((forall a. HydrationDomBuilderT s t m a -> HydrationDomBuilderT s t m a) -> HydrationDomBuilderT s t m b) -> HydrationDomBuilderT s t m b #

MonadJSM m => MonadJSM (HydrationDomBuilderT s t m) Source # 
Instance details

Defined in Reflex.Dom.Builder.Immediate

Methods

liftJSM' :: JSM a -> HydrationDomBuilderT s t m a #

PrimMonad m => PrimMonad (HydrationDomBuilderT s t m) Source # 
Instance details

Defined in Reflex.Dom.Builder.Immediate

Associated Types

type PrimState (HydrationDomBuilderT s t m) #

MonadRef m => MonadRef (HydrationDomBuilderT s t m) Source # 
Instance details

Defined in Reflex.Dom.Builder.Immediate

Associated Types

type Ref (HydrationDomBuilderT s t m) :: Type -> Type #

Methods

newRef :: a -> HydrationDomBuilderT s t m (Ref (HydrationDomBuilderT s t m) a) #

readRef :: Ref (HydrationDomBuilderT s t m) a -> HydrationDomBuilderT s t m a #

writeRef :: Ref (HydrationDomBuilderT s t m) a -> a -> HydrationDomBuilderT s t m () #

modifyRef :: Ref (HydrationDomBuilderT s t m) a -> (a -> a) -> HydrationDomBuilderT s t m () #

modifyRef' :: Ref (HydrationDomBuilderT s t m) a -> (a -> a) -> HydrationDomBuilderT s t m () #

MonadAtomicRef m => MonadAtomicRef (HydrationDomBuilderT s t m) Source # 
Instance details

Defined in Reflex.Dom.Builder.Immediate

Methods

atomicModifyRef :: Ref (HydrationDomBuilderT s t m) a -> (a -> (a, b)) -> HydrationDomBuilderT s t m b #

atomicModifyRef' :: Ref (HydrationDomBuilderT s t m) a -> (a -> (a, b)) -> HydrationDomBuilderT s t m b #

HasJSContext m => HasJSContext (HydrationDomBuilderT s t m) Source # 
Instance details

Defined in Reflex.Dom.Builder.Immediate

Associated Types

type JSContextPhantom (HydrationDomBuilderT s t m) Source #

(RawDocument (DomBuilderSpace (HydrationDomBuilderT s t m)) ~ Document, Monad m) => HasDocument (HydrationDomBuilderT s t m) Source # 
Instance details

Defined in Reflex.Dom.Builder.Immediate

type PrimState (HydrationDomBuilderT s t m) Source # 
Instance details

Defined in Reflex.Dom.Builder.Immediate

type Ref (HydrationDomBuilderT s t m) Source # 
Instance details

Defined in Reflex.Dom.Builder.Immediate

type Ref (HydrationDomBuilderT s t m) = Ref m
type Performable (HydrationDomBuilderT s t m) Source # 
Instance details

Defined in Reflex.Dom.Builder.Immediate

type JSX (HydrationDomBuilderT s t m) Source # 
Instance details

Defined in Reflex.Dom.Builder.Immediate

type JSX (HydrationDomBuilderT s t m) = JSX m
type JSContextPhantom (HydrationDomBuilderT s t m) Source # 
Instance details

Defined in Reflex.Dom.Builder.Immediate

type DomFragment (HydrationDomBuilderT GhcjsDomSpace t m) Source # 
Instance details

Defined in Reflex.Dom.Builder.Immediate

type DomBuilderSpace (HydrationDomBuilderT HydrationDomSpace t m) Source # 
Instance details

Defined in Reflex.Dom.Builder.Immediate

type DomBuilderSpace (HydrationDomBuilderT GhcjsDomSpace t m) Source # 
Instance details

Defined in Reflex.Dom.Builder.Immediate

type Client (HydrationDomBuilderT HydrationDomSpace t m) Source # 
Instance details

Defined in Reflex.Dom.Prerender

type Client (HydrationDomBuilderT GhcjsDomSpace t m) Source # 
Instance details

Defined in Reflex.Dom.Prerender

data HydrationDomBuilderEnv t m Source #

Constructors

HydrationDomBuilderEnv 

Fields

newtype HydrationRunnerT t m a Source #

The monad which performs the delayed actions to reuse prerendered nodes and set up events. State contains reference to the previous node sibling, if any, and the reader contains reference to the parent node.

Constructors

HydrationRunnerT 

Fields

Instances

Instances details
MonadReflexCreateTrigger t m => MonadReflexCreateTrigger t (HydrationRunnerT t m) Source # 
Instance details

Defined in Reflex.Dom.Builder.Immediate

Methods

newEventWithTrigger :: (EventTrigger t a -> IO (IO ())) -> HydrationRunnerT t m (Event t a) #

newFanEventWithTrigger :: GCompare k => (forall a. k a -> EventTrigger t a -> IO (IO ())) -> HydrationRunnerT t m (EventSelector t k) #

MonadTrans (HydrationRunnerT t) Source # 
Instance details

Defined in Reflex.Dom.Builder.Immediate

Methods

lift :: Monad m => m a -> HydrationRunnerT t m a #

MonadSample t m => MonadSample (t :: Type) (HydrationRunnerT t m) Source # 
Instance details

Defined in Reflex.Dom.Builder.Immediate

Methods

sample :: Behavior t a -> HydrationRunnerT t m a #

(Reflex t, MonadFix m) => DomRenderHook (t :: Type) (HydrationRunnerT t m) Source # 
Instance details

Defined in Reflex.Dom.Builder.Immediate

Monad m => Monad (HydrationRunnerT t m) Source # 
Instance details

Defined in Reflex.Dom.Builder.Immediate

Methods

(>>=) :: HydrationRunnerT t m a -> (a -> HydrationRunnerT t m b) -> HydrationRunnerT t m b #

(>>) :: HydrationRunnerT t m a -> HydrationRunnerT t m b -> HydrationRunnerT t m b #

return :: a -> HydrationRunnerT t m a #

Functor m => Functor (HydrationRunnerT t m) Source # 
Instance details

Defined in Reflex.Dom.Builder.Immediate

Methods

fmap :: (a -> b) -> HydrationRunnerT t m a -> HydrationRunnerT t m b #

(<$) :: a -> HydrationRunnerT t m b -> HydrationRunnerT t m a #

MonadFix m => MonadFix (HydrationRunnerT t m) Source # 
Instance details

Defined in Reflex.Dom.Builder.Immediate

Methods

mfix :: (a -> HydrationRunnerT t m a) -> HydrationRunnerT t m a #

Monad m => Applicative (HydrationRunnerT t m) Source # 
Instance details

Defined in Reflex.Dom.Builder.Immediate

Methods

pure :: a -> HydrationRunnerT t m a #

(<*>) :: HydrationRunnerT t m (a -> b) -> HydrationRunnerT t m a -> HydrationRunnerT t m b #

liftA2 :: (a -> b -> c) -> HydrationRunnerT t m a -> HydrationRunnerT t m b -> HydrationRunnerT t m c #

(*>) :: HydrationRunnerT t m a -> HydrationRunnerT t m b -> HydrationRunnerT t m b #

(<*) :: HydrationRunnerT t m a -> HydrationRunnerT t m b -> HydrationRunnerT t m a #

MonadIO m => MonadIO (HydrationRunnerT t m) Source # 
Instance details

Defined in Reflex.Dom.Builder.Immediate

Methods

liftIO :: IO a -> HydrationRunnerT t m a #

MonadException m => MonadException (HydrationRunnerT t m) Source # 
Instance details

Defined in Reflex.Dom.Builder.Immediate

Methods

throw :: Exception e => e -> HydrationRunnerT t m a #

catch :: Exception e => HydrationRunnerT t m a -> (e -> HydrationRunnerT t m a) -> HydrationRunnerT t m a #

finally :: HydrationRunnerT t m a -> HydrationRunnerT t m b -> HydrationRunnerT t m a #

MonadAsyncException m => MonadAsyncException (HydrationRunnerT t m) Source # 
Instance details

Defined in Reflex.Dom.Builder.Immediate

Methods

mask :: ((forall a. HydrationRunnerT t m a -> HydrationRunnerT t m a) -> HydrationRunnerT t m b) -> HydrationRunnerT t m b #

MonadJSM m => MonadJSM (HydrationRunnerT t m) Source # 
Instance details

Defined in Reflex.Dom.Builder.Immediate

Methods

liftJSM' :: JSM a -> HydrationRunnerT t m a #

addHydrationStep :: MonadIO m => HydrationRunnerT t m () -> HydrationDomBuilderT s t m () Source #

Add a hydration step

addHydrationStepWithSetup :: (Adjustable t m, MonadIO m) => m a -> (a -> HydrationRunnerT t m ()) -> HydrationDomBuilderT s t m () Source #

Add a hydration step which depends on some computation that should only be done *before* the switchover to immediate mode - this is most likely some form of hold which we want to remove after hydration is done

removeSubsequentNodes :: (MonadJSM m, IsNode n) => n -> m () Source #

Remove all nodes after given node

deleteBetweenExclusive :: (MonadJSM m, IsNode start, IsNode end) => start -> end -> m () Source #

s and e must both be children of the same node and s must precede e; all nodes between s and e will be removed, but s and e will not be removed

extractBetweenExclusive :: (MonadJSM m, IsNode start, IsNode end) => DocumentFragment -> start -> end -> m () Source #

s and e must both be children of the same node and s must precede e; all nodes between s and e will be moved into the given DocumentFragment, but s and e will not be moved

deleteUpTo :: (MonadJSM m, IsNode start, IsNode end) => start -> end -> m () Source #

s and e must both be children of the same node and s must precede e; s and all nodes between s and e will be removed, but e will not be removed

extractUpTo :: (MonadJSM m, IsNode start, IsNode end) => DocumentFragment -> start -> end -> m () Source #

collectUpTo :: (MonadJSM m, IsNode start, IsNode end) => start -> end -> m DocumentFragment Source #

collectUpToGivenParent :: (MonadJSM m, IsNode parent, IsNode start, IsNode end) => parent -> start -> end -> m DocumentFragment Source #

newtype EventTriggerRef t a #

A reference to an EventTrigger suitable for firing with TriggerEventT.

Constructors

EventTriggerRef 

newtype EventFilterTriggerRef t er (en :: EventTag) Source #

Constructors

EventFilterTriggerRef (IORef (Maybe (EventTrigger t (er en)))) 

wrap :: forall s m er t. (Reflex t, MonadJSM m, MonadReflexCreateTrigger t m, DomRenderHook t m, EventSpec s ~ GhcjsEventSpec) => Chan [DSum (EventTriggerRef t) TriggerInvocation] -> Element -> RawElementConfig er t s -> m (DMap EventName (EventFilterTriggerRef t er)) Source #

This wrap is only partial: it doesn't create the EventSelector itself

data HydrationDomSpace Source #

Instances

Instances details
(Adjustable t m, PrerenderBaseConstraints js t m, ReflexHost t) => Prerender js t (HydrationDomBuilderT HydrationDomSpace t m) Source # 
Instance details

Defined in Reflex.Dom.Prerender

Associated Types

type Client (HydrationDomBuilderT HydrationDomSpace t m) :: Type -> Type Source #

SupportsHydrationDomBuilder t m => DomBuilder t (HydrationDomBuilderT HydrationDomSpace t m) Source # 
Instance details

Defined in Reflex.Dom.Builder.Immediate

Methods

textNode :: TextNodeConfig t -> HydrationDomBuilderT HydrationDomSpace t m (TextNode (DomBuilderSpace (HydrationDomBuilderT HydrationDomSpace t m)) t) Source #

commentNode :: CommentNodeConfig t -> HydrationDomBuilderT HydrationDomSpace t m (CommentNode (DomBuilderSpace (HydrationDomBuilderT HydrationDomSpace t m)) t) Source #

element :: forall (er :: EventTag -> Type) a. Text -> ElementConfig er t (DomBuilderSpace (HydrationDomBuilderT HydrationDomSpace t m)) -> HydrationDomBuilderT HydrationDomSpace t m a -> HydrationDomBuilderT HydrationDomSpace t m (Element er (DomBuilderSpace (HydrationDomBuilderT HydrationDomSpace t m)) t, a) Source #

inputElement :: forall (er :: EventTag -> Type). InputElementConfig er t (DomBuilderSpace (HydrationDomBuilderT HydrationDomSpace t m)) -> HydrationDomBuilderT HydrationDomSpace t m (InputElement er (DomBuilderSpace (HydrationDomBuilderT HydrationDomSpace t m)) t) Source #

textAreaElement :: forall (er :: EventTag -> Type). TextAreaElementConfig er t (DomBuilderSpace (HydrationDomBuilderT HydrationDomSpace t m)) -> HydrationDomBuilderT HydrationDomSpace t m (TextAreaElement er (DomBuilderSpace (HydrationDomBuilderT HydrationDomSpace t m)) t) Source #

selectElement :: forall (er :: EventTag -> Type) a. SelectElementConfig er t (DomBuilderSpace (HydrationDomBuilderT HydrationDomSpace t m)) -> HydrationDomBuilderT HydrationDomSpace t m a -> HydrationDomBuilderT HydrationDomSpace t m (SelectElement er (DomBuilderSpace (HydrationDomBuilderT HydrationDomSpace t m)) t, a) Source #

placeRawElement :: RawElement (DomBuilderSpace (HydrationDomBuilderT HydrationDomSpace t m)) -> HydrationDomBuilderT HydrationDomSpace t m () Source #

wrapRawElement :: forall (er :: EventTag -> Type). RawElement (DomBuilderSpace (HydrationDomBuilderT HydrationDomSpace t m)) -> RawElementConfig er t (DomBuilderSpace (HydrationDomBuilderT HydrationDomSpace t m)) -> HydrationDomBuilderT HydrationDomSpace t m (Element er (DomBuilderSpace (HydrationDomBuilderT HydrationDomSpace t m)) t) Source #

DomSpace HydrationDomSpace Source # 
Instance details

Defined in Reflex.Dom.Builder.Immediate

Methods

addEventSpecFlags :: forall proxy (en :: EventTag) er. proxy HydrationDomSpace -> EventName en -> (Maybe (er en) -> EventFlags) -> EventSpec HydrationDomSpace er -> EventSpec HydrationDomSpace er Source #

type EventSpec HydrationDomSpace Source # 
Instance details

Defined in Reflex.Dom.Builder.Immediate

type RawDocument HydrationDomSpace Source # 
Instance details

Defined in Reflex.Dom.Builder.Immediate

type RawTextNode HydrationDomSpace Source # 
Instance details

Defined in Reflex.Dom.Builder.Immediate

type RawCommentNode HydrationDomSpace Source # 
Instance details

Defined in Reflex.Dom.Builder.Immediate

type RawElement HydrationDomSpace Source # 
Instance details

Defined in Reflex.Dom.Builder.Immediate

type RawInputElement HydrationDomSpace Source # 
Instance details

Defined in Reflex.Dom.Builder.Immediate

type RawTextAreaElement HydrationDomSpace Source # 
Instance details

Defined in Reflex.Dom.Builder.Immediate

type RawSelectElement HydrationDomSpace Source # 
Instance details

Defined in Reflex.Dom.Builder.Immediate

type DomBuilderSpace (HydrationDomBuilderT HydrationDomSpace t m) Source # 
Instance details

Defined in Reflex.Dom.Builder.Immediate

type Client (HydrationDomBuilderT HydrationDomSpace t m) Source # 
Instance details

Defined in Reflex.Dom.Prerender

data GhcjsDomSpace Source #

Instances

Instances details
(ReflexHost t, Adjustable t m, PrerenderBaseConstraints js t m) => Prerender js t (HydrationDomBuilderT GhcjsDomSpace t m) Source # 
Instance details

Defined in Reflex.Dom.Prerender

Associated Types

type Client (HydrationDomBuilderT GhcjsDomSpace t m) :: Type -> Type Source #

SupportsHydrationDomBuilder t m => MountableDomBuilder t (HydrationDomBuilderT GhcjsDomSpace t m) Source # 
Instance details

Defined in Reflex.Dom.Builder.Immediate

SupportsHydrationDomBuilder t m => DomBuilder t (HydrationDomBuilderT GhcjsDomSpace t m) Source # 
Instance details

Defined in Reflex.Dom.Builder.Immediate

Methods

textNode :: TextNodeConfig t -> HydrationDomBuilderT GhcjsDomSpace t m (TextNode (DomBuilderSpace (HydrationDomBuilderT GhcjsDomSpace t m)) t) Source #

commentNode :: CommentNodeConfig t -> HydrationDomBuilderT GhcjsDomSpace t m (CommentNode (DomBuilderSpace (HydrationDomBuilderT GhcjsDomSpace t m)) t) Source #

element :: forall (er :: EventTag -> Type) a. Text -> ElementConfig er t (DomBuilderSpace (HydrationDomBuilderT GhcjsDomSpace t m)) -> HydrationDomBuilderT GhcjsDomSpace t m a -> HydrationDomBuilderT GhcjsDomSpace t m (Element er (DomBuilderSpace (HydrationDomBuilderT GhcjsDomSpace t m)) t, a) Source #

inputElement :: forall (er :: EventTag -> Type). InputElementConfig er t (DomBuilderSpace (HydrationDomBuilderT GhcjsDomSpace t m)) -> HydrationDomBuilderT GhcjsDomSpace t m (InputElement er (DomBuilderSpace (HydrationDomBuilderT GhcjsDomSpace t m)) t) Source #

textAreaElement :: forall (er :: EventTag -> Type). TextAreaElementConfig er t (DomBuilderSpace (HydrationDomBuilderT GhcjsDomSpace t m)) -> HydrationDomBuilderT GhcjsDomSpace t m (TextAreaElement er (DomBuilderSpace (HydrationDomBuilderT GhcjsDomSpace t m)) t) Source #

selectElement :: forall (er :: EventTag -> Type) a. SelectElementConfig er t (DomBuilderSpace (HydrationDomBuilderT GhcjsDomSpace t m)) -> HydrationDomBuilderT GhcjsDomSpace t m a -> HydrationDomBuilderT GhcjsDomSpace t m (SelectElement er (DomBuilderSpace (HydrationDomBuilderT GhcjsDomSpace t m)) t, a) Source #

placeRawElement :: RawElement (DomBuilderSpace (HydrationDomBuilderT GhcjsDomSpace t m)) -> HydrationDomBuilderT GhcjsDomSpace t m () Source #

wrapRawElement :: forall (er :: EventTag -> Type). RawElement (DomBuilderSpace (HydrationDomBuilderT GhcjsDomSpace t m)) -> RawElementConfig er t (DomBuilderSpace (HydrationDomBuilderT GhcjsDomSpace t m)) -> HydrationDomBuilderT GhcjsDomSpace t m (Element er (DomBuilderSpace (HydrationDomBuilderT GhcjsDomSpace t m)) t) Source #

DomSpace GhcjsDomSpace Source # 
Instance details

Defined in Reflex.Dom.Builder.Immediate

Methods

addEventSpecFlags :: forall proxy (en :: EventTag) er. proxy GhcjsDomSpace -> EventName en -> (Maybe (er en) -> EventFlags) -> EventSpec GhcjsDomSpace er -> EventSpec GhcjsDomSpace er Source #

type EventSpec GhcjsDomSpace Source # 
Instance details

Defined in Reflex.Dom.Builder.Immediate

type RawDocument GhcjsDomSpace Source # 
Instance details

Defined in Reflex.Dom.Builder.Immediate

type RawTextNode GhcjsDomSpace Source # 
Instance details

Defined in Reflex.Dom.Builder.Immediate

type RawCommentNode GhcjsDomSpace Source # 
Instance details

Defined in Reflex.Dom.Builder.Immediate

type RawElement GhcjsDomSpace Source # 
Instance details

Defined in Reflex.Dom.Builder.Immediate

type RawInputElement GhcjsDomSpace Source # 
Instance details

Defined in Reflex.Dom.Builder.Immediate

type RawTextAreaElement GhcjsDomSpace Source # 
Instance details

Defined in Reflex.Dom.Builder.Immediate

type RawSelectElement GhcjsDomSpace Source # 
Instance details

Defined in Reflex.Dom.Builder.Immediate

type DomFragment (HydrationDomBuilderT GhcjsDomSpace t m) Source # 
Instance details

Defined in Reflex.Dom.Builder.Immediate

type DomBuilderSpace (HydrationDomBuilderT GhcjsDomSpace t m) Source # 
Instance details

Defined in Reflex.Dom.Builder.Immediate

type Client (HydrationDomBuilderT GhcjsDomSpace t m) Source # 
Instance details

Defined in Reflex.Dom.Prerender

newtype GhcjsDomHandler a b Source #

Constructors

GhcjsDomHandler 

Fields

newtype GhcjsDomHandler1 a b Source #

Constructors

GhcjsDomHandler1 

Fields

newtype GhcjsDomEvent en Source #

Constructors

GhcjsDomEvent 

newtype GhcjsEventFilter er en Source #

Constructors

GhcjsEventFilter (GhcjsDomEvent en -> JSM (EventFlags, JSM (Maybe (er en)))) 

data Pair1 (f :: k -> *) (g :: k -> *) (a :: k) Source #

Constructors

Pair1 (f a) (g a) 

data Maybe1 f a Source #

Constructors

Nothing1 
Just1 (f a) 

class Monad m => HasDocument m where Source #

Minimal complete definition

Nothing

Instances

Instances details
HasDocument m => HasDocument (HydratableT m) Source # 
Instance details

Defined in Reflex.Dom.Builder.Hydratable

HasDocument m => HasDocument (InputDisabledT m) Source # 
Instance details

Defined in Reflex.Dom.Builder.InputDisabled

HasDocument m => HasDocument (ReaderT r m) Source # 
Instance details

Defined in Reflex.Dom.Builder.Class

HasDocument m => HasDocument (PostBuildT t m) Source # 
Instance details

Defined in Reflex.Dom.Builder.Class

HasDocument m => HasDocument (DynamicWriterT t w m) Source # 
Instance details

Defined in Reflex.Dom.Builder.Class

HasDocument m => HasDocument (QueryT t q m) Source # 
Instance details

Defined in Reflex.Dom.Builder.Class

HasDocument m => HasDocument (EventWriterT t w m) Source # 
Instance details

Defined in Reflex.Dom.Builder.Class

(SupportsStaticDomBuilder t m, Monad m) => HasDocument (StaticDomBuilderT t m) Source # 
Instance details

Defined in Reflex.Dom.Builder.Static

HasDocument m => HasDocument (RequesterT t request response m) Source # 
Instance details

Defined in Reflex.Dom.Builder.Class

Methods

askDocument :: RequesterT t request response m (RawDocument (DomBuilderSpace (RequesterT t request response m))) Source #

(RawDocument (DomBuilderSpace (HydrationDomBuilderT s t m)) ~ Document, Monad m) => HasDocument (HydrationDomBuilderT s t m) Source # 
Instance details

Defined in Reflex.Dom.Builder.Immediate

newtype GhcjsEventHandler er Source #

Constructors

GhcjsEventHandler 

Fields

drawChildUpdate :: (MonadJSM m, Reflex t) => HydrationDomBuilderEnv t m -> (IORef (ChildReadyState k) -> JSM ()) -> HydrationDomBuilderT s t m (f a) -> DomRenderHookT t m (Compose (TraverseChild t m k) f a) Source #

insertBefore :: (MonadJSM m, IsNode new, IsNode existing) => new -> existing -> m () Source #

type family EventType en where ... Source #

Equations

EventType 'AbortTag = UIEvent 
EventType 'BlurTag = FocusEvent 
EventType 'ChangeTag = Event 
EventType 'ClickTag = MouseEvent 
EventType 'ContextmenuTag = MouseEvent 
EventType 'DblclickTag = MouseEvent 
EventType 'DragTag = MouseEvent 
EventType 'DragendTag = MouseEvent 
EventType 'DragenterTag = MouseEvent 
EventType 'DragleaveTag = MouseEvent 
EventType 'DragoverTag = MouseEvent 
EventType 'DragstartTag = MouseEvent 
EventType 'DropTag = MouseEvent 
EventType 'ErrorTag = UIEvent 
EventType 'FocusTag = FocusEvent 
EventType 'InputTag = Event 
EventType 'InvalidTag = Event 
EventType 'KeydownTag = KeyboardEvent 
EventType 'KeypressTag = KeyboardEvent 
EventType 'KeyupTag = KeyboardEvent 
EventType 'LoadTag = UIEvent 
EventType 'MousedownTag = MouseEvent 
EventType 'MouseenterTag = MouseEvent 
EventType 'MouseleaveTag = MouseEvent 
EventType 'MousemoveTag = MouseEvent 
EventType 'MouseoutTag = MouseEvent 
EventType 'MouseoverTag = MouseEvent 
EventType 'MouseupTag = MouseEvent 
EventType 'MousewheelTag = MouseEvent 
EventType 'ScrollTag = UIEvent 
EventType 'SelectTag = UIEvent 
EventType 'SubmitTag = Event 
EventType 'WheelTag = WheelEvent 
EventType 'BeforecutTag = ClipboardEvent 
EventType 'CutTag = ClipboardEvent 
EventType 'BeforecopyTag = ClipboardEvent 
EventType 'CopyTag = ClipboardEvent 
EventType 'BeforepasteTag = ClipboardEvent 
EventType 'PasteTag = ClipboardEvent 
EventType 'ResetTag = Event 
EventType 'SearchTag = Event 
EventType 'SelectstartTag = Event 
EventType 'TouchstartTag = TouchEvent 
EventType 'TouchmoveTag = TouchEvent 
EventType 'TouchendTag = TouchEvent 
EventType 'TouchcancelTag = TouchEvent 

withIsEvent :: EventName en -> (IsEvent (EventType en) => r) -> r Source #

elementOnEventName :: IsElement e => EventName en -> e -> EventM e (EventType en) () -> JSM (JSM ()) Source #

wrapDomEvent :: (TriggerEvent t m, MonadJSM m) => e -> (e -> EventM e event () -> JSM (JSM ())) -> EventM e event a -> m (Event t a) Source #

subscribeDomEvent :: (EventM e event () -> JSM (JSM ())) -> EventM e event (Maybe a) -> Chan [DSum (EventTriggerRef t) TriggerInvocation] -> EventTrigger t a -> JSM (JSM ()) Source #

wrapDomEventMaybe :: (TriggerEvent t m, MonadJSM m) => e -> (e -> EventM e event () -> JSM (JSM ())) -> EventM e event (Maybe a) -> m (Event t a) Source #

wrapDomEventsMaybe :: (MonadJSM m, MonadReflexCreateTrigger t m) => e -> (forall en. IsEvent (EventType en) => EventName en -> EventM e (EventType en) (Maybe (f en))) -> (forall en. EventName en -> e -> EventM e (EventType en) () -> JSM (JSM ())) -> ImmediateDomBuilderT t m (EventSelector t (WrapArg f EventName)) Source #

data WindowConfig t Source #

Constructors

WindowConfig 

Instances

Instances details
Default (WindowConfig t) Source # 
Instance details

Defined in Reflex.Dom.Builder.Immediate

Methods

def :: WindowConfig t #

Attributes for controlling hydration

hydratableAttribute :: IsString s => s Source #

An attribute which signals that an element should be hydrated.

skipHydrationAttribute :: IsString s => s Source #

An attribute which causes hydration to skip over an element completely.

Internal

traverseDMapWithKeyWithAdjust' :: forall s t m (k :: * -> *) v v'. (Adjustable t m, MonadHold t m, MonadFix m, MonadJSM m, PrimMonad m, GCompare k, RawDocument (DomBuilderSpace (HydrationDomBuilderT s t m)) ~ Document) => (forall a. k a -> v a -> HydrationDomBuilderT s t m (v' a)) -> DMap k v -> Event t (PatchDMap k v) -> HydrationDomBuilderT s t m (DMap k v', Event t (PatchDMap k v')) Source #

hoistTraverseWithKeyWithAdjust Source #

Arguments

:: (Adjustable t m, MonadHold t m, GCompare k, MonadIO m, MonadJSM m, PrimMonad m, MonadFix m, Patch (p k v), Patch (p k (Constant Int)), PatchTarget (p k (Constant Int)) ~ DMap k (Constant Int), Patch (p k (Compose (TraverseChild t m (Some k)) v')), PatchTarget (p k (Compose (TraverseChild t m (Some k)) v')) ~ DMap k (Compose (TraverseChild t m (Some k)) v'), Monoid (p k (Compose (TraverseChild t m (Some k)) v')), RawDocument (DomBuilderSpace (HydrationDomBuilderT s t m)) ~ Document) 
=> (forall vv vv'. (forall a. k a -> vv a -> DomRenderHookT t m (vv' a)) -> DMap k vv -> Event t (p k vv) -> DomRenderHookT t m (DMap k vv', Event t (p k vv')))

The base monad's traversal

-> (forall vv vv'. (forall a. vv a -> vv' a) -> p k vv -> p k vv')

A way of mapping over the patch type

-> (p k (Compose (TraverseChild t m (Some k)) v') -> DMap k (Constant (IORef (ChildReadyState (Some k)))) -> IO (DMap k (Constant (IORef (ChildReadyState (Some k))))))

Given a patch for the children DOM elements, produce a patch for the childrens' unreadiness state

-> (IORef (Map (Some k) Text) -> Text -> p k (Compose (TraverseChild t m (Some k)) v') -> JSM ())

Apply a patch to the DOM

-> (forall a. k a -> v a -> HydrationDomBuilderT s t m (v' a)) 
-> DMap k v 
-> Event t (p k v) 
-> HydrationDomBuilderT s t m (DMap k v', Event t (p k v')) 

hoistTraverseIntMapWithKeyWithAdjust Source #

Arguments

:: (Adjustable t m, MonadHold t m, MonadJSM m, MonadFix m, PrimMonad m, Monoid (p (TraverseChild t m Int v')), Functor p, PatchTarget (p (HydrationRunnerT t m ())) ~ IntMap (HydrationRunnerT t m ()), PatchTarget (p (TraverseChild t m Int v')) ~ IntMap (TraverseChild t m Int v'), Patch (p (HydrationRunnerT t m ())), Patch (p (TraverseChild t m Int v')), RawDocument (DomBuilderSpace (HydrationDomBuilderT s t m)) ~ Document) 
=> ((Key -> v -> DomRenderHookT t m (TraverseChild t m Int v')) -> IntMap v -> Event t (p v) -> DomRenderHookT t m (IntMap (TraverseChild t m Int v'), Event t (p (TraverseChild t m Int v'))))

The base monad's traversal

-> (p (TraverseChild t m Int v') -> IntMap (IORef (ChildReadyState Int)) -> IO (IntMap (IORef (ChildReadyState Int))))

Given a patch for the children DOM elements, produce a patch for the childrens' unreadiness state

-> (IORef (IntMap Text) -> Text -> p (TraverseChild t m Int v') -> JSM ())

Apply a patch to the DOM

-> (Key -> v -> HydrationDomBuilderT s t m v') 
-> IntMap v 
-> Event t (p v) 
-> HydrationDomBuilderT s t m (IntMap v', Event t (p v'))