aboutsummaryrefslogtreecommitdiff
path: root/client/src/Util
diff options
context:
space:
mode:
authorJoris2018-10-30 20:44:12 +0100
committerJoris2018-10-30 20:44:12 +0100
commitb5244184920b4d7a8d64eada2eca21e9a6ea2df9 (patch)
treec15f9e30cb31a3fb067e0660f9cf62a94d452a4c /client/src/Util
parent8a28f608d8e08fba4bbe54b46804d261686c3c03 (diff)
Use waitfor with delete confirm button
Diffstat (limited to 'client/src/Util')
-rw-r--r--client/src/Util/WaitFor.hs9
1 files changed, 4 insertions, 5 deletions
diff --git a/client/src/Util/WaitFor.hs b/client/src/Util/WaitFor.hs
index 7d5e7c5..46882aa 100644
--- a/client/src/Util/WaitFor.hs
+++ b/client/src/Util/WaitFor.hs
@@ -9,10 +9,9 @@ import qualified Reflex.Dom as R
waitFor
:: forall t m a b. MonadWidget t m
=> (Event t a -> m (Event t b))
- -> Event t ()
- -> Dynamic t a
+ -> Event t a
-> m (Event t b, Event t Bool)
-waitFor op start input = do
- result <- op (R.tag (R.current input) start) >>= R.debounce (0.5 :: NominalDiffTime)
- let waiting = R.leftmost [ const True <$> start , const False <$> result ]
+waitFor op input = do
+ result <- op input >>= R.debounce (0.2 :: NominalDiffTime)
+ let waiting = R.leftmost [ const True <$> input , const False <$> result ]
return (result, waiting)