Skip to content

Instantly share code, notes, and snippets.

@et4te
Last active August 26, 2017 14:08
Show Gist options
  • Save et4te/c337eaaa7db367df92ec3e0bd5022b65 to your computer and use it in GitHub Desktop.
Save et4te/c337eaaa7db367df92ec3e0bd5022b65 to your computer and use it in GitHub Desktop.
An example of performEventAsync use Reflex
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