-
Notifications
You must be signed in to change notification settings - Fork 20
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
How would you handle HTTP requests? #67
Comments
@8483 could you please share a bit more detail about your HTTP request? |
@nelsonic That was a quick response. :) Yes, I am talking about getting data from a RESTful API and updating the model with the response data.
As far as I got it, commands are used as a message sent after a message, and tasks as handling impure things. It would be cool if they were explained via a Javascript example, but sadly, I am unable to contribute the explanation as I don't fully grasp them. |
@8483 your understanding of |
For what it is worth, I would definitely be interested in seeing the elmish Todo app expanded to elmishly talk to APIs/servers with vanilla JS. What would elm commands look like in the vanilla JS elmish Todo app? Would we also have to add on to elmish.js or perhaps make our own Http.js and JSON.js (for encoding form inputs) modules? I don't know if there's still any interest in this, but I would love to see something like that here. Following the tutorial so far has been very useful for me. If anyone knows of a similar elmish tutorial that also covers API/server communication, that would also interest me. |
The ELM Architecture handles HTTP requests outside of the
mount
function, as it considers them impure.Do we simply execute the request inside of the
update
switch statement i.e. break the pattern?The text was updated successfully, but these errors were encountered: