Skip to content

Commit

Permalink
Merge pull request #399 from reflex-frp/ts-xhr-ping-pong
Browse files Browse the repository at this point in the history
Use onSync for handling XHR onreadystatechange
  • Loading branch information
3noch authored Jul 16, 2020
2 parents 0261ab7 + 9f862f9 commit dc8d55a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions reflex-dom-core/src/Reflex/Dom/Xhr/Foreign.hs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import Data.Text (Text)
import Data.ByteString (ByteString)
import Foreign.JavaScript.Utils (bsFromMutableArrayBuffer, bsToArrayBuffer)
import GHCJS.DOM.Enums
import GHCJS.DOM.EventM (EventM, on)
import GHCJS.DOM.EventM (EventM, on, onSync)
import GHCJS.DOM.EventTarget (dispatchEvent)
import GHCJS.DOM.Types (MonadJSM, ToJSString, FormData, Document, Blob (..), ArrayBuffer (..), JSVal, JSM, IsEvent, XMLHttpRequestProgressEvent, ProgressEvent, Event, XMLHttpRequestUpload, FromJSString, ArrayBufferView (..), liftJSM, castTo)
import GHCJS.DOM.XMLHttpRequest
Expand Down Expand Up @@ -114,7 +114,7 @@ xmlHttpRequestOntimeout :: XMLHttpRequest -> EventM XMLHttpRequest ProgressEvent
xmlHttpRequestOntimeout = (`on` timeout)

xmlHttpRequestOnreadystatechange :: XMLHttpRequest -> EventM XMLHttpRequest Event () -> JSM (JSM ())
xmlHttpRequestOnreadystatechange = (`on` readyStateChange)
xmlHttpRequestOnreadystatechange = (`onSync` readyStateChange)

xmlHttpRequestSetTimeout :: MonadJSM m => XMLHttpRequest -> Word -> m ()
xmlHttpRequestSetTimeout = setTimeout
Expand Down

0 comments on commit dc8d55a

Please sign in to comment.