Safe Haskell | None |
---|---|
Language | Haskell2010 |
This makes it easy to create auto-save operations not limited to saves.
Synopsis
- withInputDebounceEvt :: (PostBuild t m, MonadFix m, MonadHold t m, TriggerEvent t m, MonadIO (Performable m), PerformEvent t m) => NominalDiffTime -> (result -> Bool) -> (b -> Event t inputEvt -> m (Event t result)) -> (Dynamic t InputStates -> m (b, Event t inputEvt)) -> m (Event t result, b)
- withInput :: (PostBuild t m, MonadFix m, MonadHold t m) => (Event t inputEvt -> m (Event t inputEvt)) -> (actionResult -> Bool) -> (actArgs -> Event t inputEvt -> m (Event t actionResult)) -> (Event t actionResult -> Dynamic t InputStates -> m (actArgs, Event t inputEvt, innerWidgetResult)) -> m (Event t actionResult, innerWidgetResult)
- data InputStates
- defStateAttr :: InputStates -> Text
Documentation
:: (PostBuild t m, MonadFix m, MonadHold t m, TriggerEvent t m, MonadIO (Performable m), PerformEvent t m) | |
=> NominalDiffTime | Delay before posting the request |
-> (result -> Bool) | Was the final requess successfull? For example: (isJust . reqSuccess) |
-> (b -> Event t inputEvt -> m (Event t result)) | Action function |
-> (Dynamic t InputStates -> m (b, Event t inputEvt)) | Widget body reacting to states |
-> m (Event t result, b) |
do a debounced action, create a widget with the dynamic inputstates that indicates the state of doing the action This allows you to automatically request the server once user is finished with typing for example, while not flooding the server with requests trough debouncing
:: (PostBuild t m, MonadFix m, MonadHold t m) | |
=> (Event t inputEvt -> m (Event t inputEvt)) | change input timeline, eg pure for no change |
-> (actionResult -> Bool) | Was the final requess successfull? |
-> (actArgs -> Event t inputEvt -> m (Event t actionResult)) | Action function |
-> (Event t actionResult -> Dynamic t InputStates -> m (actArgs, Event t inputEvt, innerWidgetResult)) | Widget body reacting to states |
-> m (Event t actionResult, innerWidgetResult) |
A general debounce widget
This looks a lot like actionForm
, but it's not the same because
form allows user code to decide what
data InputStates Source #
Allows widgets to react according with what's happening
defStateAttr :: InputStates -> Text Source #
Maps input state to bulmex classes: InputStarted = is-warning for example