Skip to content

Instantly share code, notes, and snippets.

@Nijhazer
Created December 2, 2015 03:30
Show Gist options
  • Save Nijhazer/cb89ad586371670727a6 to your computer and use it in GitHub Desktop.
Save Nijhazer/cb89ad586371670727a6 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