paldepind / functional-frontend-architecture

A functional frontend framework.
MIT License
1.44k stars 87 forks source link

add http example (zip-codes) #4

Closed ericgj closed 9 years ago

ericgj commented 9 years ago

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.

paldepind commented 9 years ago

Looks splendid! Thank you for making this.

paldepind commented 9 years ago

Oops. I pressed the wrong button ;)