Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow metadata to be captured with requests #6

Open
3noch opened this issue Oct 12, 2017 · 2 comments
Open

Allow metadata to be captured with requests #6

3noch opened this issue Oct 12, 2017 · 2 comments

Comments

@3noch
Copy link
Contributor

3noch commented Oct 12, 2017

servant-reflex has the notion of a "tag" (not to be confused with tagging Events, etc.) where an XHR request can be "tagged" with some meta information that will be given back with the response. The meta information has no role in the XHR interaction itself. It's merely a "snapshot" of some state at the time the request was made. This is helpful to track the value of things at the time of a request, even if those values may have changed since the request was made.

It would be useful to have such a feature here as well. For example, I would use it keep track of the form data that was posted via a websocket request. I don't actually want the websocket to send back the form data. I just need to know what that form data was when I made the request. As long as the request comes back with "Ok" then I know the form data in the "tag" is correct. But I can avoid having to send it back in the websocket.

@3noch
Copy link
Contributor Author

3noch commented Oct 12, 2017

This may be possible by holding a value on the same event as the WebSocket request event.

@dfordivam
Copy link
Owner

dfordivam commented Dec 15, 2017

As a work around, I used a simple holdDyn, but if you are sending multiple requests then the implementation will be tricky..
I know how to do this properly in library... but to make it compile is just hard work...

Actually I tried implementing but realized holdDyn is good enough for me... so will come back to this later

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants