Hacker News new | ask | show | jobs
by holler 2228 days ago
for things like loading state with ember we use a library called ember-concurrency that uses the generator approach. It's very nice!

Example you can create some "task" (promise-like), then in a template you have automatic access to it's state so e.g.

``` {{#if this.fetchStoriesTask.isRunning}} loading... {{else}} <span>Loaded 10 Stories</span> {{/if}} ``` https://github.com/machty/ember-concurrency

1 comments

ember-concurrency is probably at the top of the list for things I miss most when writing javascript outside of ember.