kopia lustrzana https://github.com/c9/core
Update to outplan 0.0.4
rodzic
592bc9c11b
commit
82796e89c5
|
@ -37,8 +37,11 @@ define(function(require, exports, module) {
|
||||||
return outplan.create(name, choices, options);
|
return outplan.create(name, choices, options);
|
||||||
}
|
}
|
||||||
|
|
||||||
function get(experimentName, overrideUserId) {
|
function expose(experimentName, overrideUserId, options) {
|
||||||
return outplan.get(experimentName, overrideUserId == null ? userId : overrideUserId);
|
if (overrideUserId && typeof overrideUserId === "object")
|
||||||
|
return expose(experimentName, null, options);
|
||||||
|
|
||||||
|
return outplan.expose(experimentName, overrideUserId == null ? userId : overrideUserId, options);
|
||||||
}
|
}
|
||||||
|
|
||||||
function isUserCreatedAfter(experimentDate) {
|
function isUserCreatedAfter(experimentDate) {
|
||||||
|
@ -71,16 +74,15 @@ define(function(require, exports, module) {
|
||||||
create: create,
|
create: create,
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the selected variation of an experiment. Alias for require("outplan").get()
|
* Get the selected variation of an experiment, and call the log function with
|
||||||
* but doesn't require a userId
|
* an "expose" event to track its exposure.
|
||||||
*
|
*
|
||||||
* As a side effect, this calls the log function with an "expose" event
|
* @param {String} name The experiment name.
|
||||||
* with the selected experiment variation.
|
* @param {Number} [userId] A unique identifier for the current user.
|
||||||
*
|
* @param {Object} [options] Options
|
||||||
* @param {String} name The experiment name.
|
* @param {Boolean} [options.log=true] Whether to log an "exposure event"
|
||||||
* @param {String|Number} [userId] A unique identifier for the current user.
|
|
||||||
*/
|
*/
|
||||||
get: get,
|
expose: expose,
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Helper to determine if the current user was created after the start of an experiment.
|
* Helper to determine if the current user was created after the start of an experiment.
|
||||||
|
|
Ładowanie…
Reference in New Issue