Skip to content

Commit 32e6e15

Browse files
committed
Tidy code again
1 parent 6ae82b6 commit 32e6e15

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

src/index.ts

+12-12
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,12 @@ function withAndroidInterface(callback: (_: SnowplowWebInterface) => void) {
3030
}
3131
}
3232

33+
function withAndroidInterfaceV2(callback: (_: SnowplowWebInterfaceV2) => void) {
34+
if (window.SnowplowWebInterfaceV2) {
35+
callback(window.SnowplowWebInterfaceV2);
36+
}
37+
}
38+
3339
function withIOSInterface(callback: (_: WebkitMessageHandler) => void) {
3440
if (
3541
window.webkit &&
@@ -40,18 +46,6 @@ function withIOSInterface(callback: (_: WebkitMessageHandler) => void) {
4046
}
4147
}
4248

43-
function withReactNativeInterface(callback: (_: ReactNativeInterface) => void) {
44-
if (window.ReactNativeWebView) {
45-
callback(window.ReactNativeWebView);
46-
}
47-
}
48-
49-
function withAndroidInterfaceV2(callback: (_: SnowplowWebInterfaceV2) => void) {
50-
if (window.SnowplowWebInterfaceV2) {
51-
callback(window.SnowplowWebInterfaceV2);
52-
}
53-
}
54-
5549
function withIOSInterfaceV2(callback: (_: WebkitMessageHandlerV2) => void) {
5650
if (
5751
window.webkit &&
@@ -62,6 +56,12 @@ function withIOSInterfaceV2(callback: (_: WebkitMessageHandlerV2) => void) {
6256
}
6357
}
6458

59+
function withReactNativeInterface(callback: (_: ReactNativeInterface) => void) {
60+
if (window.ReactNativeWebView) {
61+
callback(window.ReactNativeWebView);
62+
}
63+
}
64+
6565
function serializeContext(context?: Array<SelfDescribingJson> | null) {
6666
if (context) {
6767
return JSON.stringify(context);

0 commit comments

Comments
 (0)