Module

Impulse.DOM.API

Package
purescript-impulse
Repository
mitchdzugan/purescript-impulse

#DOM Source

type DOM e c a = Reader (DOMClass e c) a

#Collector Source

data Collector :: Type -> Type

#createElement Source

createElement :: forall a c e. String -> Attrs -> DOM e c a -> DOM e c (ImpulseEl a)

#createElement_ Source

createElement_ :: forall a e r. String -> Attrs -> DOM r e a -> DOM r e a

#text Source

text :: forall c e. String -> DOM e c Unit

#s_use Source

s_use :: forall a c e. (SigBuilder a) -> DOM e c (Signal a)

#s_bindDOM Source

s_bindDOM :: forall b a c e. Signal a -> (a -> DOM e c b) -> DOM e c (Signal b)

#s_bindDOM_ Source

s_bindDOM_ :: forall b a e r. Signal a -> (a -> DOM r e b) -> DOM r e Unit

#e_collect Source

e_collect :: forall cOSymless cO cSym cI e sym a res. IsSymbol sym => Lacks sym () => Cons sym (Collector a) () cSym => Cons sym (Collector a) cOSymless cO => Union cSym cI cO => SProxy sym -> (Event a -> DOM e (Record cO) res) -> DOM e (Record cI) res

#e_emit Source

e_emit :: forall l c2 c1 a e. IsSymbol l => Cons l (Collector a) c1 c2 => SProxy l -> Event a -> DOM e (Record c2) Unit

#d_memo Source

d_memo :: forall b a c e. Hashable a => a -> (a -> DOM e c b) -> DOM e c b

#d_stash Source

d_stash :: forall a c e. DOM e c a -> DOM e c (ImpulseStash a)

d_stash inner

runs inner but does not render in place, instead stashes whatever was rendered such that it can be used later using d_apply. stashes are immutable and can be passed around as far as you like.

   test :: forall e c. DOM e c Unit
   test = do
     ul_ anil do
       stash <- d_stash do
         li_ anil $ text "out"
         li_ anil $ text "of"
         li_ anil $ text "order?"
       li_ anil $ text "You"
       li_ anil $ text "thought"
       li_ anil $ text "this"
       li_ anil $ text "was"
       d_apply stash

results in

  <ul>
      <li>You</li>
      <li>thought</li>
      <li>this</li>
      <li>was</li>
      <li>out</li>
      <li>of</li>
      <li>order?</li>
  </ul>

#d_apply Source

d_apply :: forall a c e. ImpulseStash a -> DOM e c a

#d_apply_ Source

d_apply_ :: forall a c e. ImpulseStash a -> DOM e c Unit

#keyed Source

keyed :: forall a c e. String -> DOM e c a -> DOM e c a

#attach Source

attach :: forall a e. String -> e -> DOM e (Record ()) a -> Effect (ImpulseAttachment a)

#toMarkup Source

toMarkup :: forall a e. e -> DOM e (Record ()) a -> Effect (ImpulseSSR a)

#ImpulseStash Source

#stashRes Source

stashRes :: forall a. ImpulseStash a -> a

#ImpulseSSR Source

data ImpulseSSR :: Type -> Type

#ssr_then Source

ssr_then :: forall a. ImpulseSSR a -> (String -> a -> Effect Unit) -> Effect Unit

#ImpulseAttachment Source

#detach Source

#attachRes Source

attachRes :: forall a. ImpulseAttachment a -> a

#env Source

env :: forall c e. DOM e c e

#withAlteredEnv Source

withAlteredEnv :: forall a c e2 e1. (e1 -> e2) -> DOM e2 c a -> DOM e1 c a

#DOMClass Source

data DOMClass :: Type -> Type -> Type

#dnil Source

dnil :: forall c e. DOM e c Unit

#_eff Source

_eff :: forall a c e. Effect a -> DOM e c a