Skip to content

Commit 15b279d

Browse files
committed
Add code for wrapped callback into plugin
1 parent a028720 commit 15b279d

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

lib/raven-plugin.js

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,16 @@
2020
'use strict';
2121
import {NativeModules} from 'react-native';
2222

23-
var wrappedCallback = require('../src/utils').wrappedCallback;
23+
function wrappedCallback(callback) {
24+
function dataCallback(data, original) {
25+
var normalizedData = callback(data) || data;
26+
if (original) {
27+
return original(normalizedData) || normalizedData;
28+
}
29+
return normalizedData;
30+
}
31+
return dataCallback;
32+
}
2433

2534
// Example React Native path format (iOS):
2635
// /var/containers/Bundle/Application/{DEVICE_ID}/HelloWorld.app/main.jsbundle

0 commit comments

Comments
 (0)