Last active
August 26, 2017 14:08
-
-
Save et4te/c337eaaa7db367df92ec3e0bd5022b65 to your computer and use it in GitHub Desktop.
An example of performEventAsync use Reflex
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
performHash :: (MonadWidget t m) => (Either String Hash -> IO ()) -> Event t Text -> m (Event t (Either String Hash)) | |
performHash cb e = do | |
evHash <- performEventAsync $ ffor e $ \p cb -> void $ newHash p $ liftIO . cb | |
return evHash | |
where | |
newHash p = liftIO . hash (defaultOptions p "some_salt") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment