bulmex-3.0.0: Reflex infused with bulma (css)

Reflex.Bulmex.Form

Contents

Description

Form capture enter presses and provide an html like control flow. They also indicate to the child monad how an action is performing with spinstates.

Synopsis

# Documentation

Arguments

 :: (DomBuilder t m, MonadHold t m, MonadFix m) => (a -> Event t () -> m (Event t b)) Action function -> (Event t b -> Dynamic t FormState -> m (a, Event t FormAction, c)) form body -> m c

This function mimics an arbitrary html form in control flow. The first argument is the action function with arbitrary input a and a trigger event. This returns another event in a monadic context.

action="(a -> Event t () -> m (Event t b))"

This perfectly aligns with servant-reflex. The produced event is given to the form, the second argument. which is the form body:

<form>(Event t b -> Dynamic t FormState -> m (a, Event t FormAction, c))</form>

and also includes the FormState, indicating if we're executing the action or not. The form has to return 3 values, the information for the action function, The FormAction event that controls the form, and the third is a return value for the form.

form :: (DomBuilder t m, MonadFix m) => (Event t () -> m a) -> m a Source #

A form captures enter presses of child componetns and sends it to them in an event.

# Spin

Arguments

 :: (DomBuilder t m, PerformEvent t m, TriggerEvent t m, MonadIO (Performable m), MonadHold t m, MonadFix m) => (Dynamic t FormState -> m (Event t ())) Widget body -> (Event t () -> m (Event t b)) Trigger function -> m (Event t b)

A more general use of the spinstate. The first argument is the widget that can indicate when to execute the second function. It will be made aware of the FormState.

withSpinDyn :: (DomBuilder t m, PerformEvent t m, TriggerEvent t m, MonadIO (Performable m), MonadHold t m, MonadFix m) => AttrMap -> (Dynamic t AttrMap -> m (Event t ())) -> (Event t () -> m (Event t b)) -> m (Event t b) Source #

aSpinButtonClass :: (DomBuilder t m, PostBuild t m) => Text -> Dynamic t FormState -> m () -> m (Event t ()) Source #