Created
April 21, 2020 14:45
-
-
Save reggi/6d26da43aea51532d95b12060494cdcd to your computer and use it in GitHub Desktop.
This file contains 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
class MongoOptions () { | |
static parse () { | |
// does all the parsing without async eg DNS checking operations | |
} | |
static performAsync () { | |
// follow up handler to check eg DNS (async) tasks | |
} | |
static parseAsync () { | |
// does parsing with | |
} | |
} | |
class MongoClient () { | |
constructor (uri, options = defaultOptions) { | |
this.parsedOptions = MongoOptions.parse() | |
} | |
connection (uri, options = defaultOptions, callback) { | |
MongoOptions.parseAsync(uri, options, (parsedOptions) => { | |
}) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment