Skip to content

Commit 492c3b6

Browse files
committed
chore: update dependencies and improve code formatting
1 parent 410e84a commit 492c3b6

File tree

5 files changed

+261
-32
lines changed

5 files changed

+261
-32
lines changed

example/src/hooks/useIterableApp.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,9 @@ export const IterableAppProvider: FunctionComponent<
9696
const [apiKey, setApiKey] = useState<string | undefined>(
9797
process.env.ITBL_API_KEY
9898
);
99-
const [userId, setUserId] = useState<string | null>(process.env.ITBL_ID ?? null);
99+
const [userId, setUserId] = useState<string | null>(
100+
process.env.ITBL_ID ?? null
101+
);
100102
const [loginInProgress, setLoginInProgress] = useState<boolean>(false);
101103

102104
const getUserId = useCallback(() => userId ?? process.env.ITBL_ID, [userId]);

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,12 +85,13 @@
8585
"commitlint": "^19.6.1",
8686
"del-cli": "^5.1.0",
8787
"eslint": "^8.51.0",
88-
"eslint-config-prettier": "^9.0.0",
88+
"eslint-config-prettier": "^10.1.8",
8989
"eslint-plugin-jest": "^28.9.0",
9090
"eslint-plugin-prettier": "^5.0.1",
9191
"eslint-plugin-tsdoc": "^0.3.0",
9292
"jest": "^29.7.0",
9393
"prettier": "^3.0.3",
94+
"prettier-eslint": "^16.4.2",
9495
"react": "19.0.0",
9596
"react-native": "0.79.3",
9697
"react-native-builder-bob": "^0.40.4",

src/api/NativeRNIterableAPI.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,6 @@ export interface Spec extends TurboModule {
120120
// Wake app -- android only
121121
wakeApp(): void;
122122

123-
124123
// REQUIRED for RCTEventEmitter
125124
addListener(eventName: string): void;
126125
removeListeners(count: number): void;

src/core/classes/Iterable.ts

Lines changed: 29 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,5 @@
11
/* eslint-disable eslint-comments/no-unlimited-disable */
2-
import {
3-
Linking,
4-
NativeEventEmitter,
5-
Platform,
6-
} from 'react-native';
2+
import { Linking, NativeEventEmitter, Platform } from 'react-native';
73

84
import { buildInfo } from '../../itblBuildInfo';
95

@@ -361,7 +357,13 @@ export class Iterable {
361357
Iterable?.logger?.log('getAttributionInfo');
362358

363359
return RNIterableAPI.getAttributionInfo().then(
364-
(dict: { campaignId: number; templateId: number; messageId: string } | null) => {
360+
(
361+
dict: {
362+
campaignId: number;
363+
templateId: number;
364+
messageId: string;
365+
} | null
366+
) => {
365367
if (dict) {
366368
return new IterableAttributionInfo(
367369
dict.campaignId as number,
@@ -402,7 +404,11 @@ export class Iterable {
402404
static setAttributionInfo(attributionInfo?: IterableAttributionInfo) {
403405
Iterable?.logger?.log('setAttributionInfo');
404406

405-
RNIterableAPI.setAttributionInfo(attributionInfo as unknown as { [key: string]: string | number | boolean; } | null);
407+
RNIterableAPI.setAttributionInfo(
408+
attributionInfo as unknown as {
409+
[key: string]: string | number | boolean;
410+
} | null
411+
);
406412
}
407413

408414
/**
@@ -481,7 +487,9 @@ export class Iterable {
481487
static updateCart(items: IterableCommerceItem[]) {
482488
Iterable?.logger?.log('updateCart');
483489

484-
RNIterableAPI.updateCart(items as unknown as { [key: string]: string | number | boolean }[]);
490+
RNIterableAPI.updateCart(
491+
items as unknown as { [key: string]: string | number | boolean }[]
492+
);
485493
}
486494

487495
/**
@@ -533,7 +541,11 @@ export class Iterable {
533541
) {
534542
Iterable?.logger?.log('trackPurchase');
535543

536-
RNIterableAPI.trackPurchase(total, items as unknown as { [key: string]: string | number | boolean }[], dataFields as { [key: string]: string | number | boolean } | undefined);
544+
RNIterableAPI.trackPurchase(
545+
total,
546+
items as unknown as { [key: string]: string | number | boolean }[],
547+
dataFields as { [key: string]: string | number | boolean } | undefined
548+
);
537549
}
538550

539551
/**
@@ -702,7 +714,10 @@ export class Iterable {
702714
static trackEvent(name: string, dataFields?: unknown) {
703715
Iterable?.logger?.log('trackEvent');
704716

705-
RNIterableAPI.trackEvent(name, dataFields as { [key: string]: string | number | boolean } | undefined);
717+
RNIterableAPI.trackEvent(
718+
name,
719+
dataFields as { [key: string]: string | number | boolean } | undefined
720+
);
706721
}
707722

708723
/**
@@ -750,7 +765,10 @@ export class Iterable {
750765
) {
751766
Iterable?.logger?.log('updateUser');
752767

753-
RNIterableAPI.updateUser(dataFields as { [key: string]: string | number | boolean }, mergeNestedObjects);
768+
RNIterableAPI.updateUser(
769+
dataFields as { [key: string]: string | number | boolean },
770+
mergeNestedObjects
771+
);
754772
}
755773

756774
/**

0 commit comments

Comments
 (0)