UNPKG

@clearbit-dcp/clearbit.js-core

Version:

The hassle-free way to integrate analytics into any web application.

59 lines (42 loc) 771 B
'use strict'; /* * 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: 'cb_group_id' }, localStorage: { key: 'cb_group_properties' } }; /** * Initialize a new `Group` with `options`. * * @param {Object} 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;