Comments (2)
There is no function at the moment to do this, but it would be fairly straightforward to implement one, as the module exports newXMLHttpRequest
You will have to write your own version of performRequestAsync'
. I think the following should work (I haven't tested this though). Here tag
can be any arbitrary data.
performRequestAsyncWithTag :: (MonadJSM (Performable m), PerformEvent t m, TriggerEvent t m) => (XhrRequest p -> (a -> JSM ()) -> Performable m XMLHttpRequest) -> Event t (Performable m (XhrRequest p, tag)) -> m (Event t (a, tag))
performRequestAsyncWithTag newXhr req = performEventAsync $ ffor req $ \hr cb -> do
(r, tag) <- hr
_ <- newXhr r $ \resp -> liftIO (cb (resp, tag))
return ()
To use this do performRequestAsyncWithTag newXMLHttpRequest xhrReqEv
, where xhrReqEv
would contain the tag along with XhrReqest
from reflex-dom.
Indeed, it seems pretty simple.
Thx for the snippet 👍 Will try it out
from reflex-dom.
Related Issues (20)
- inputElementConfig_initialValue doen't work after reload HOT 4
- Is MountableDomBuilder a deadcode
- Checked property doesn't work correctly for radio inputs
- `inputElement` initial value does not show and `setValue` does not work for custom event HOT 2
- Building on Windows.
- Support multiple form data values to be associated with the same name
- Error building release.nix: bitbucket.org/wuzzeb/webdriver-utils/get/a8b1552... returns 404 HOT 3
- sortableList.hs example outdated
- How to set focus of an element HOT 6
- reflex-dom-core is not compatible with patch >= 0.0.5.0 HOT 2
- implement _*ElementConfig_setFocus HOT 1
- How to debug: jsaddle requests: 101 pending
- Support GHC 9.2.3
- play method of audio element HOT 2
- Missing HTTP headers get reported as the empty string
- Dropdown Map becomes empty only when deployed HOT 1
- reflex-dom 0.6.3.1 uses unreleasead reflex-dom-core function HOT 1
- Integrating reflex-dom with Yesod
- support for ghc-9.4/9.6? HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from reflex-dom.