Skip to content
This repository was archived by the owner on May 30, 2024. It is now read-only.
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ var newClient = function(sdkKey, config) {
client.emit('ready');
}
});

client.initialized = function() {
return initComplete;
};
Expand All @@ -129,20 +129,20 @@ var newClient = function(sdkKey, config) {
if (initComplete) {
return Promise.resolve();
}

return new Promise(function(resolve) {
client.once('ready', resolve);
});
};

client.waitForInitialization = function() {
if (initComplete) {
return Promise.resolve();
return Promise.resolve(client);
}
if (failure) {
return Promise.reject(failure);
}

return new Promise(function(resolve, reject) {
client.once('ready', resolve);
client.once('failed', reject);
Expand Down Expand Up @@ -197,7 +197,7 @@ var newClient = function(sdkKey, config) {
sendFlagEvent(key, flag, user, null, defaultVal, defaultVal);
return resolve(defaultVal);
}

evaluate.evaluate(flag, user, config.featureStore, function(err, variation, value, events) {
var i;
var version = flag ? flag.version : null;
Expand All @@ -221,7 +221,7 @@ var newClient = function(sdkKey, config) {
} else {
sendFlagEvent(key, flag, user, variation, value, defaultVal);
return resolve(value);
}
}
});
});
}
Expand Down Expand Up @@ -321,7 +321,7 @@ var newClient = function(sdkKey, config) {
return client[newName].apply(client, arguments);
};
}

deprecatedMethod('all_flags', 'allFlags');
deprecatedMethod('is_offline', 'isOffline');
deprecatedMethod('secure_mode_hash', 'secureModeHash');
Expand Down