Skip to content

Instantly share code, notes, and snippets.

@ferlores
Created April 26, 2012 03:50
Show Gist options
  • Save ferlores/2495657 to your computer and use it in GitHub Desktop.
Save ferlores/2495657 to your computer and use it in GitHub Desktop.
Presenter API
/*
* Interface for a isomorphic Presenter
*/
//NODE enviroment - Director can make something similar
module.exports = Presenter.extend({
'name': 'posts',
'/posts get': function(){},
'/posts post': function(){},
'/posts put': function(){},
'/posts/:id delete': function(id){}
});
//Browser enviroment - could be a jQuery pluglin
(Presenter.extend({
'name': 'posts',
'/posts route': function(){},
'/posts/:id route': function(id){},
'#button click': function(){},
}))(jQuery);
$('#someDiv').posts();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment