Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: typescript definition for optional data attributes #51

Merged
merged 2 commits into from
Apr 20, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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