Created
December 2, 2015 03:30
-
-
Save Nijhazer/cb89ad586371670727a6 to your computer and use it in GitHub Desktop.
Building Applications with TypeScript - Snippet 12
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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