This is a translation of Elm's "zip codes" example, designed to show one way of handling asychronous tasks -- specifically, http requests.
It's not my favorite example for several reasons -- for one thing, it's very US-centric -- for another, being 'stateless' it's not very representative of most apps. But I think it could be useful for people to see side-by-side with the original. A lot of the ceremony needed by Elm (ports, mailboxes, etc., which I don't really understand very well yet) I found could be simplified since we're directly in the browser context.
But would appreciate your views on it and on dealing with async tasks in general using this architecture, & of course feel free to modify this example as you see fit.
This is a translation of Elm's "zip codes" example, designed to show one way of handling asychronous tasks -- specifically, http requests.
It's not my favorite example for several reasons -- for one thing, it's very US-centric -- for another, being 'stateless' it's not very representative of most apps. But I think it could be useful for people to see side-by-side with the original. A lot of the ceremony needed by Elm (ports, mailboxes, etc., which I don't really understand very well yet) I found could be simplified since we're directly in the browser context.
But would appreciate your views on it and on dealing with async tasks in general using this architecture, & of course feel free to modify this example as you see fit.