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

Http.send behavior #44

Closed
smiley325 opened this Issue Dec 12, 2014 · 4 comments

Comments

Projects
None yet
2 participants
@smiley325

smiley325 commented Dec 12, 2014

From the mailing list:

Right now, the way Http.send works, the Waiting state only occurs for the first request. If the URL changes thereafter, it will maintain the previous Response until the new response comes in. I can see why that would be a useful behavior to have, especially if you hook up your output/views directly to the response signal.

In more stateful applications however, it would be useful to have a different Http.send (not sure what I would name it) which, when the URL changes, will revert to the Waiting state while waiting for the new response to come in. This would allow someone to have a loading animation be displayed whenever requests to the server are happening, so the user is aware that something is being waited on. In this style, if the programmer wants to display the old results while the new results are fetching, he can do that by storing results in his/her application state.

Jeff Smits added that under this new behavior, "you can do a dropIf ((==) Waiting) Waiting to get the old heaviour back." Whereas you cannot derive this new behavior from the old behavior.

Just wanted to put this suggestion out there for the next revision of Http. The change itself is just a single line swap in Native/Http.js

@evancz

This comment has been minimized.

Show comment
Hide comment
@evancz

evancz Dec 12, 2014

Member

Oh, I thought I made it the way you described it should be. So maybe that's a bug?

Here's the thing though, I am redesigning this library right now, so the next release should be strictly better in a ton of different ways. I think this will be part of that. So the answer is sort of, everything's gonna be better soon.

Member

evancz commented Dec 12, 2014

Oh, I thought I made it the way you described it should be. So maybe that's a bug?

Here's the thing though, I am redesigning this library right now, so the next release should be strictly better in a ton of different ways. I think this will be part of that. So the answer is sort of, everything's gonna be better soon.

@smiley325

This comment has been minimized.

Show comment
Hide comment
@smiley325

smiley325 Dec 12, 2014

Bug or not, I think at this point it is what it is, especially since you're redesigning now. Is there a design doc or some kind of notes to preview the new redesign? And how will the version bump look?

I have some rather garish offline/online caching stuff that depends heavily on Http, just wanted to make sure the semantics I chose are not overly dissonant from the new Http that's coming.

smiley325 commented Dec 12, 2014

Bug or not, I think at this point it is what it is, especially since you're redesigning now. Is there a design doc or some kind of notes to preview the new redesign? And how will the version bump look?

I have some rather garish offline/online caching stuff that depends heavily on Http, just wanted to make sure the semantics I chose are not overly dissonant from the new Http that's coming.

@evancz

This comment has been minimized.

Show comment
Hide comment
@evancz

evancz Dec 12, 2014

Member

Still early stages, I'll share on the mailing list when there's something more solid. It should be possible to recreate the old API with it if you really want to.

Member

evancz commented Dec 12, 2014

Still early stages, I'll share on the mailing list when there's something more solid. It should be possible to recreate the old API with it if you really want to.

@evancz

This comment has been minimized.

Show comment
Hide comment
@evancz

evancz May 11, 2016

Member

This stuff lives in evancz/elm-http now.

Member

evancz commented May 11, 2016

This stuff lives in evancz/elm-http now.

@evancz evancz closed this May 11, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment