Skip to content

Instantly share code, notes, and snippets.

@bnjbvr
bnjbvr / gist:a54828e75328d4922d89
Created March 27, 2015 19:55
Transform a (err, ..., callback) based function into a Promise-based function
function promisify(func) {
return function(...args) {
return new Promise(function(resolve, reject) {
func(...args, function(err, ...rest) {
if (err)
return reject(err);
resolve(...rest);
});
});
}

Recently, we've been working on extracting Ember conventions from applications we're working on into the framework. Our goal is to make it clearer how the parts of an Ember application work together, and how to organize and bootstrap your objects.

Routing

Routing is an important part of web applications. It allows your users to share the URL they see in their browser, and have the same things appear when their friends click on the link.

The Ember.js ecosystem has several great solutions for routing. But, since it is such an important part of most web applications, we've decided to build it right into the framework.

If you have already modeled your application state using Ember.StateManager, there are a few changes you'll need to make to enable routing. Once you've made those changes, you'll notice the browser's address bar spring to life as you start using your app—just by moving between states, Ember.js will update the URL automatically.