@segment/analytics.js-core
Version:
The hassle-free way to integrate analytics into any web application.
42 lines (41 loc) • 814 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
/*
* Module dependencies.
*/
var Entity = require('./entity');
var bindAll = require('bind-all');
var debug = require('debug')('analytics:group');
var inherit = require('inherits');
/**
* Group defaults
*/
Group.defaults = {
persist: true,
cookie: {
key: 'ajs_group_id'
},
localStorage: {
key: 'ajs_group_properties'
}
};
/**
* Initialize a new `Group` with `options`.
*/
function Group(options) {
this.defaults = Group.defaults;
this.debug = debug;
Entity.call(this, options);
}
/**
* Inherit `Entity`
*/
inherit(Group, Entity);
/**
* Expose the group singleton.
*/
module.exports = bindAll(new Group());
/**
* Expose the `Group` constructor.
*/
module.exports.Group = Group;