Skip to content

Commit b78628e

Browse files
authored
Merge pull request #14 from creately/fixes-bug-loading
Fixed issues related to loading the tracker
2 parents ab60474 + 337ceae commit b78628e

File tree

5 files changed

+23
-25
lines changed

5 files changed

+23
-25
lines changed

package-lock.json

Lines changed: 1 addition & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@creately/siddi",
3-
"version": "1.0.6",
3+
"version": "1.0.7",
44
"description": "A convenient event tracker API which sends events to multiple consumers",
55
"main": "dist/siddi.js",
66
"scripts": {

src/__tests__/consumers.spec.ts

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -3,23 +3,23 @@ import { Consumers } from '../consumers';
33
describe('Consumers', () => {
44
const mixpanel = {
55
__loaded: true,
6-
identify: () => { },
7-
track: () => { },
6+
identify: () => {},
7+
track: () => {},
88
people: {
9-
set: () => { },
9+
set: () => {},
1010
},
1111
};
1212

1313
const heap = {
14-
track: () => { },
15-
identify: () => { },
16-
addUserProperties: () => { },
14+
track: () => {},
15+
identify: () => {},
16+
addUserProperties: () => {},
1717
};
1818

1919
const amplitudeInstance = {
20-
setUserId: () => { },
21-
setUserProperties: () => { },
22-
logEvent: () => { },
20+
setUserId: () => {},
21+
setUserProperties: () => {},
22+
logEvent: () => {},
2323
};
2424

2525
const amplitude = {
@@ -28,13 +28,13 @@ describe('Consumers', () => {
2828
};
2929

3030
const outbound = {
31-
identify: () => { },
32-
track: () => { },
31+
identify: () => {},
32+
track: () => {},
3333
};
3434

35-
const snowplow = () => { };
35+
const snowplow = () => {};
3636

37-
const ga = () => { };
37+
const ga = () => {};
3838

3939
describe('mixpanel', () => {
4040
beforeEach(() => {
@@ -112,7 +112,7 @@ describe('Consumers', () => {
112112
});
113113
describe('track', () => {
114114
beforeEach(() => {
115-
heap.track = () => { };
115+
heap.track = () => {};
116116
jest.spyOn(heap, 'track');
117117
});
118118
it('should send given tracking data', () => {
@@ -230,7 +230,7 @@ describe('Consumers', () => {
230230
});
231231
describe('track', () => {
232232
beforeEach(() => {
233-
outbound.track = () => { };
233+
outbound.track = () => {};
234234
jest.spyOn(outbound, 'track');
235235
});
236236
it('should send given tracking data', () => {

src/consumers.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ declare global {
2424
outbound: any;
2525
ga: any;
2626
snowplow: any;
27-
snowplowschema: string;//Variable which holds the schema path
27+
snowplowschema: string; //Variable which holds the schema path
2828
}
2929
}
3030

@@ -101,9 +101,9 @@ export const Consumers: ConsumerConfiguration = {
101101
eventProperties.event = eventName;
102102
const selfDescribingEvent = {
103103
schema: window.snowplowschema,
104-
data: eventProperties
105-
}
106-
window.snowplow( 'trackSelfDescribingEvent', selfDescribingEvent );
104+
data: eventProperties,
105+
};
106+
window.snowplow('trackSelfDescribingEvent', selfDescribingEvent);
107107
},
108-
}
108+
},
109109
};

src/siddi.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ export class Siddi {
114114
* @param eventName event name
115115
*/
116116
private shouldTrack(consumerConfig: EventConfiguration, eventName: string): boolean {
117-
const config = Object.assign(this.defaultConsumerRule, consumerConfig);
117+
const config = Object.assign({}, this.defaultConsumerRule, consumerConfig);
118118

119119
const denyOptions = config.deny;
120120
const allowOptions = config.allow;

0 commit comments

Comments
 (0)