From d71eca2342a5cdcef780521825648ccbc857d013 Mon Sep 17 00:00:00 2001 From: Paul Scott Date: Thu, 22 Oct 2020 15:32:30 +0100 Subject: [PATCH] Re-export Core. --- lib/core.js | 7 +------ lib/track.js | 4 +--- 2 files changed, 2 insertions(+), 9 deletions(-) diff --git a/lib/core.js b/lib/core.js index 97cccdf..983f9a8 100644 --- a/lib/core.js +++ b/lib/core.js @@ -20,17 +20,12 @@ import { promiseRetry, bind, uuid } from './util'; * {@link module:promise} module for compatiblity with Internet Explorer. */ -// Exporting this way makes the Core class look static rather than exported, but -// then we don't get the ugly constructor name "exports.Core" instead of just -// "Core". -// export { Core }; - /** * Core library instance. Provides helpers and device identification. * @class * @param {CoreConfig} cfg */ -function Core(cfg) { +export function Core(cfg) { this.Promise = cfg.Promise || window.Promise; // API connectivity. TODO Move to an API client? diff --git a/lib/track.js b/lib/track.js index 3aa179d..c371eee 100644 --- a/lib/track.js +++ b/lib/track.js @@ -1,8 +1,6 @@ import { uuid } from "./util"; import version from "./version"; -export { Track }; - /** * @typedef {object} TrackConfig * @prop {boolean} [init=true] Whether to hook into the browser. @@ -14,7 +12,7 @@ export { Track }; * @param {Core} core * @param {TrackConfig} [cfg] */ -function Track(core, cfg) { +export function Track(core, cfg) { this.core = core; /** @prop {string} windowId An identifier which lasts until the next page refresh. */