@@ -33,11 +33,11 @@ import qualified Data.Text as T
3333import qualified Data.Text.Lazy as TL
3434import qualified Data.Text.Encoding as T
3535import Data.Traversable (forM)
36−import Language.Javascript.JSaddle.Monad (JSM, MonadJSM)
36+import Language.Javascript.JSaddle.Monad (JSM, MonadJSM, liftJSM)
3737import qualified Language.Javascript.JSaddle as JS
3838import qualified Data.JSString.Text as JS (lazyTextFromJSString)
3939import qualified Network.URI as N
40−import Reflex.Dom hiding (tag)
40+import Reflex.Dom.Core hiding (tag)
4141import Servant.Common.BaseUrl (BaseUrl, showBaseUrl,
4242 SupportsServantReflex)
4343import Servant.API.ContentTypes ( NoContent(..), Accept, JSON
@@ -63,7 +63,7 @@ data ReqResult tag a
6363 deriving (Functor)
6464
6565data ClientOptions = ClientOptions
66− { optsRequestFixup :: forall a. Show a => XhrRequest a -> IO (XhrRequest a)
66+ { optsRequestFixup :: forall a. Show a => XhrRequest a -> JSM (XhrRequest a)
6767 -- ^ Aribtrarily modify requests just before they are sent.
6868 -- Warning: This escape hatch opens the possibility for your
6969 -- requests to diverge from what the server expects, when the
@@ -319,7 +319,7 @@ performSomeRequestsAsync opts =
319319-- | A modified version or Reflex.Dom.Xhr.performRequestsAsync
320320-- that accepts 'f (Either e (XhrRequestb))' events
321321performSomeRequestsAsync'
322− :: (MonadIO (Performable m), PerformEvent t m, TriggerEvent t m, Traversable f, Show b)
322+ :: (MonadJSM (Performable m), PerformEvent t m, TriggerEvent t m, Traversable f, Show b)
323323 => ClientOptions
324324 -> (XhrRequest b -> (a -> JSM ()) -> Performable m XMLHttpRequest)
325325 -> Event t (Performable m (f (Either Text (XhrRequest b)))) -> m (Event t (f (Either Text a)))
@@ -331,7 +331,7 @@ performSomeRequestsAsync' opts newXhr req = performEventAsync $ ffor req $ \hrs
331331 return resp
332332 Right r' -> do
333333 resp <- liftIO newEmptyMVar
334− r'' <- liftIO $ (optsRequestFixup opts) r'
334+ r'' <- liftJSM $ (optsRequestFixup opts) r'
335335 _ <- newXhr r'' $ liftIO . putMVar resp . Right
336336 return resp
337337 _ <- liftIO $ forkIO $ cb =<< forM resps takeMVar