Skip to content

Commit af9bb81

Browse files
committed
profile: rename eventData to eventAttributes
1 parent f2cad91 commit af9bb81

File tree

4 files changed

+9
-9
lines changed

4 files changed

+9
-9
lines changed

__tests__/profileTests.ts

+4-4
Original file line numberDiff line numberDiff line change
@@ -64,9 +64,9 @@ afterEach(() => {
6464
test("it tracks events", () => {
6565
const profileModule = new ProfileModule();
6666
profileModule.trackEvent("foo");
67-
profileModule.trackEvent("foo_2", new profileModule.eventData().put("$label","fooBAR"));
67+
profileModule.trackEvent("foo_2", new profileModule.eventAttributes().put("$label","fooBAR"));
6868

69-
const eventData = new profileModule.eventData();
69+
const eventData = new profileModule.eventAttributes();
7070
eventData
7171
.put("$tags", ["foo", "bar"])
7272
.put("foo", "bar")
@@ -75,8 +75,8 @@ test("it tracks events", () => {
7575
.put("int", 2)
7676
.put("date", new Date(1520352788000))
7777
.put("url", new URL("https://batch.com"))
78-
.put("object", new profileModule.eventData().put("foo","bar"))
79-
.put("object_array", [new profileModule.eventData().put("foo","bar"), new profileModule.eventData().put("foo","bar") ]);
78+
.put("object", new profileModule.eventAttributes().put("foo","bar"))
79+
.put("object_array", [new profileModule.eventAttributes().put("foo","bar"), new profileModule.eventAttributes().put("foo","bar") ]);
8080
profileModule.trackEvent("foo_3", eventData);
8181

8282
expect(mockedTrackEvent.mock.calls.length).toBe(3);

src/batchStub.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,10 @@ class PushStub implements BatchSDK.PushModule {
3434
}
3535

3636
class ProfileStub implements BatchSDK.ProfileModule {
37-
public eventData: typeof BatchSDK.BatchEventAttributes;
37+
public eventAttributes: typeof BatchSDK.BatchEventAttributes;
3838

3939
constructor() {
40-
this.eventData = BatchEventDataStub;
40+
this.eventAttributes = BatchEventDataStub;
4141
}
4242

4343
public getEditor(): BatchSDK.BatchProfileAttributeEditor {

src/modules/profile.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@ import { BatchProfileAttributeEditor } from "./profile/profileAttributeEditor";
66
import { BatchSDK } from "../../types";
77

88
export class ProfileModule implements BatchSDK.ProfileModule {
9-
public eventData: typeof BatchSDK.BatchEventAttributes;
9+
public eventAttributes: typeof BatchSDK.BatchEventAttributes;
1010

1111
constructor() {
12-
this.eventData = BatchEventAttributes;
12+
this.eventAttributes = BatchEventAttributes;
1313
}
1414

1515
identify(identifier: string | null): void {

types/index.d.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -272,7 +272,7 @@ export declare namespace BatchSDK {
272272
* Batch's profile module
273273
*/
274274
interface ProfileModule {
275-
eventData: typeof BatchEventAttributes;
275+
eventAttributes: typeof BatchEventAttributes;
276276

277277
/**
278278
* Identifies this device with a profile using a Custom User ID.

0 commit comments

Comments
 (0)