Safe Haskell | None |
---|---|
Language | Haskell2010 |
This module re-exports the complete HTML DSL,
Synopsis
- module Shpadoinkle.Html.Element
- module Shpadoinkle.Html.Property
- module Shpadoinkle.Html.Event
- debounce :: MonadJSM m => MonadIO n => NominalDiffTime -> n (Debounce m a b)
- debounceRaw :: MonadJSM m => MonadIO n => NominalDiffTime -> n ((RawNode -> RawEvent -> JSM (Continuation m a)) -> RawNode -> RawEvent -> JSM (Continuation m a))
- newtype Debounce m a b = Debounce {
- runDebounce :: (a -> (Text, Prop m b)) -> a -> (Text, Prop m b)
- throttle :: MonadIO n => NominalDiffTime -> n (Throttle m a b)
- data Throttle m a b
- runThrottle :: Throttle m a b -> (a -> (Text, Prop m b)) -> a -> (Text, Prop m b)
- module Shpadoinkle.Html.Utils
- injectProps :: [(Text, Prop m a)] -> Html m a -> Html m a
- mapProps :: ([(Text, Prop m a)] -> [(Text, Prop m a)]) -> Html m a -> Html m a
- listen :: Text -> (a -> a) -> (Text, Prop m a)
- listenC :: Text -> Continuation m a -> (Text, Prop m a)
- listenRaw :: Text -> (RawNode -> RawEvent -> JSM (Continuation m a)) -> (Text, Prop m a)
- listener :: Continuation m a -> Prop m a
- text :: Text -> Html m a
- baked :: JSM (RawNode, STM (Continuation m a)) -> Html m a
- h :: Text -> [(Text, Prop m a)] -> [Html m a] -> Html m a
- listenerProp :: (RawNode -> RawEvent -> JSM (Continuation m a)) -> Prop m a
- textProp :: Text -> Prop m a
- dataProp :: JSVal -> Prop m a
- data Html (m :: Type -> Type) a
- data Prop (a :: Type -> Type) b
Documentation
module Shpadoinkle.Html.Element
module Shpadoinkle.Html.Property
module Shpadoinkle.Html.Event
debounceRaw :: MonadJSM m => MonadIO n => NominalDiffTime -> n ((RawNode -> RawEvent -> JSM (Continuation m a)) -> RawNode -> RawEvent -> JSM (Continuation m a)) Source #
module Shpadoinkle.Html.Utils
injectProps :: [(Text, Prop m a)] -> Html m a -> Html m a Source #
Inject props into an existing Node
.
mapProps :: ([(Text, Prop m a)] -> [(Text, Prop m a)]) -> Html m a -> Html m a Source #
Transform the properties of some Node. This has no effect on TextNode
s or Potato
es.
listen :: Text -> (a -> a) -> (Text, Prop m a) Source #
Construct a listener from its Text
name and an output value.
listenC :: Text -> Continuation m a -> (Text, Prop m a) Source #
Construct a listener from its name and an event handler.
listenRaw :: Text -> (RawNode -> RawEvent -> JSM (Continuation m a)) -> (Text, Prop m a) Source #
Construct a listener from its name and an event handler.
listener :: Continuation m a -> Prop m a Source #
Construct a simple listener property that will perform an action.
h :: Text -> [(Text, Prop m a)] -> [Html m a] -> Html m a Source #
Construct an HTML element JSX-style.
listenerProp :: (RawNode -> RawEvent -> JSM (Continuation m a)) -> Prop m a Source #
Create an event listener property.
data Html (m :: Type -> Type) a Source #
This is the core type in Backend. Please note, this is NOT the Virtual DOM used by Backend. This type backs a DSL that is then interpreted into Virtual DOM by the Backend of your choosing. HTML comments are not supported. This is Church encoded for performance reasons.
Instances
Continuous Html | Given a lens, you can change the type of an Html by using the lens to convert the types of the Continuations inside it. |
Defined in Shpadoinkle.Core mapC :: (Continuation m a -> Continuation m b) -> Html m a -> Html m b Source # | |
IsString (Html m a) | Strings are overloaded as HTML text nodes:
|
Defined in Shpadoinkle.Core fromString :: String -> Html m a Source # |
data Prop (a :: Type -> Type) b Source #
Properties of a DOM node. Backend does not use attributes directly, but rather is focused on the more capable properties that may be set on a DOM node in JavaScript. If you wish to add attributes, you may do so by setting its corresponding property.
Instances
Continuous Prop | Given a lens, you can change the type of a Prop by using the lens to convert the types of the Continuations which it contains if it is a listener. |
Defined in Shpadoinkle.Core mapC :: (Continuation m a -> Continuation m b) -> Prop m a -> Prop m b Source # | |
IsString [(Text, Prop m a)] | Strings are overloaded as the class property:
|
Defined in Shpadoinkle.Core | |
Eq (Prop m a) | |
IsString (Prop m a) | Strings are overloaded as text props:
|
Defined in Shpadoinkle.Core fromString :: String -> Prop m a Source # |