Skip to content

Commit

Permalink
fix: typescript definition for optional data attributes (#51)
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexisAnzieu authored Apr 20, 2023
1 parent 162976a commit 4cec62a
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions src/CustomerioTracking.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,13 @@ const LINKING_ERROR =
const CustomerioReactnative = NativeModules.CustomerioReactnative
? NativeModules.CustomerioReactnative
: new Proxy(
{},
{
get() {
throw new Error(LINKING_ERROR);
},
}
);
{},
{
get() {
throw new Error(LINKING_ERROR);
},
}
);

class CustomerIO {
/**
Expand Down Expand Up @@ -78,7 +78,7 @@ class CustomerIO {
* @param identifier unique identifier for a profile
* @param body (Optional) data to identify a profile
*/
static identify(identifier: string, body: Object) {
static identify(identifier: string, body?: Object) {
CustomerioReactnative.identify(identifier, body);
}

Expand All @@ -99,7 +99,7 @@ class CustomerIO {
* @param name event name to be tracked
* @param data (Optional) data to be sent with event
*/
static track(name: string, data: Object) {
static track(name: string, data?: Object) {
CustomerioReactnative.track(name, data);
}

Expand Down Expand Up @@ -129,7 +129,7 @@ class CustomerIO {
* @param name name of the screen user visited
* @param data (Optional) any additional data to be sent
*/
static screen(name: string, data: Object) {
static screen(name: string, data?: Object) {
CustomerioReactnative.screen(name, data);
}

Expand Down

0 comments on commit 4cec62a

Please sign in to comment.