
Personally, I'm old-fashioned. I don't mind having to press a button to
make it go. But my preferences are obviously not the end of the discussion.
On Tue, Jul 24, 2018, 3:15 PM Joachim Breitner
Hi,
Am Dienstag, den 24.07.2018, 14:47 -0400 schrieb Joachim Breitner:
I guess I can use
https://hackage.haskell.org/package/reflex-dom-0.3/candidate/docs/Reflex-Dom...
for this somehow. But I guess I only want to delay errors, not successes – I will give it a shot
Sure, why not: https://github.com/nomeata/free-theorems-static-webui/commit/20c9aca
it seems to work. If some reflex-expert could check if this makes sense, that would be great:
-- | Errors are delayed, but successes go through immediatelly delayError :: (PerformEvent t m, MonadHold t m, TriggerEvent t m, MonadIO (Performable m)) => Dynamic t (Either a b) -> m (Dynamic t (Either a b)) delayError d = do delayedEvents <- delay 0.5 (updated d) d' <- holdDyn Nothing (Just <$> delayedEvents) return $ do now <- d past <- d' return $ case (past, now) of (Nothing, _) -> now -- before any delayed events arrive (_, Right _ ) -> now -- current value is good (Just x, Left _) -> x -- current value is bad, delay
Cheers, Joachim
-- Joachim Breitner mail@joachim-breitner.de http://www.joachim-breitner.de/ _______________________________________________ Haskell-Cafe mailing list To (un)subscribe, modify options or view archives go to: http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe Only members subscribed via the mailman list are allowed to post.