Skip to content

Instantly share code, notes, and snippets.

@mikkoh
Last active August 29, 2015 14:08
Show Gist options
  • Save mikkoh/4b22a342e33f7f841779 to your computer and use it in GitHub Desktop.
Save mikkoh/4b22a342e33f7f841779 to your computer and use it in GitHub Desktop.
promise.resolve( {
req: req,
model: require( '../model' ),
dataHBS: require( 'fs' ).readFileSync( './src/hbs/record.hbs', 'utf8' )
})
.then( modelstatic )
.then( handlebars )
.then( domappend )
.then( function( data ) {
var model = data.model;
// do something fancy
return data;
}.bind( this) )
.then( onComplete )
.catch( function( e ) {
console.log( e.stack );
});
plugin( req )
.model( require( '../model' ) )
.dataHBS( require( 'fs' ).readFileSync( './src/hbs/record.hbs', 'utf8' ) )
.then( modelstatic )
.then( handlebars )
.then( domappend )
.then( function( data ) {
var model = data.model;
// do something fancy
return data;
}.bind( this) )
.then( onComplete )
.catch( function( e ) {
console.log( e.stack );
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment