Safe Haskell | None |
---|---|
Language | Haskell2010 |
- data Command act
- = SetPropertyCommand Property JSVal
- | GetPropertyCommand JSString JSVal (JSVal -> act)
- data Action act
- = SendCommandsAction [Command act]
- | SubmitAction JSString
- | InputRefAction JSVal
- | GetPropertyAction JSString (JSVal -> act)
- class AsAction r act | r -> act where
- data Gasket = Gasket {
- _component :: ReactComponent
- _onRender :: Callback (JSVal -> IO JSVal)
- _onInputRef :: Callback (JSVal -> IO ())
- _onKeyDown :: Callback (JSVal -> IO ())
- class HasGasket c where
- mkGasket :: MModel Gasket Model -> F (Maker (Action act)) Gasket
- data Model = Model {
- _uid :: JSString
- _inputRef :: JSVal
- _placeholder :: JSString
- _className :: JSString
- class HasModel c where
- mkSuperModel :: Model -> F (Maker (Action act)) (SuperModel act)
- data Widget act
- type GModel act = WidgetGModel (Widget act)
- type MModel act = WidgetMModel (Widget act)
- type SuperModel act = WidgetSuperModel (Widget act)
- window :: Monad m => WindowT (GModel act) (ReactMlT m) ()
- gadget :: Monad m => GadgetT (Action act) (SuperModel act) m (DList (Command act))
- whenKeyDown :: JSVal -> MaybeT IO (Maybe JSString, JSVal)
Documentation
Gasket | |
|
Model | |
|
mkSuperModel :: Model -> F (Maker (Action act)) (SuperModel act) Source #
type SuperModel act = WidgetSuperModel (Widget act) Source #
window :: Monad m => WindowT (GModel act) (ReactMlT m) () Source #
This is used by parent components to render this component
gadget :: Monad m => GadgetT (Action act) (SuperModel act) m (DList (Command act)) Source #
State update logic. The best practice is to leave this in general Monad m (eg, not MonadIO). This allows gadget to use STM as the base monad which allows for combining concurrently with other stateful STM effects and still maintain a single source of truth.