Skip to content

Instantly share code, notes, and snippets.

@consoledotblog
Forked from Nijhazer/bawts-12.js
Created January 14, 2016 17:15
Show Gist options
  • Save consoledotblog/5fd4933dcac7ecaf4f95 to your computer and use it in GitHub Desktop.
Save consoledotblog/5fd4933dcac7ecaf4f95 to your computer and use it in GitHub Desktop.
Building Applications with TypeScript - Snippet 12
export class MongoDataDriver implements IDataDriver {
getConnection() : Promise {
return new Promise((resolve, reject) => {
Mongo.MongoClient.connect(this.config.connectionURL, (err, connection) => {
if (err) {
reject(err);
}
resolve(connection);
});
});
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment