add call backs

This commit is contained in:
Jonathan Rainville 2018-07-27 13:02:50 -04:00
parent 3264adf877
commit 7a6aa21596

View File

@ -20,19 +20,19 @@ Names.setProvider = function (provider, options) {
};
// resolve resolves a name into an identifier of some kind
Names.resolve = function (name) {
Names.resolve = function (name, callback) {
if (!this.currentNameSystems) {
throw new Error(this.noProviderError);
}
return this.currentNameSystems.resolve(name);
return this.currentNameSystems.resolve(name, callback);
};
// the reverse of resolve, resolves using an identifier to get to a name
Names.lookup = function (identifier) {
Names.lookup = function (identifier, callback) {
if (!this.currentNameSystems) {
throw new Error(this.noProviderError);
}
return this.currentNameSystems.lookup(identifier);
return this.currentNameSystems.lookup(identifier, callback);
};
Names.isAvailable = function () {