[Flow] Fix or suppress react-native github errors for Flow v0.12.0

This commit is contained in:
Gabe Levi
2015-06-10 13:42:41 -07:00
parent 5d154f1af4
commit b05e99a531
12 changed files with 37 additions and 22 deletions

View File

@@ -66,14 +66,14 @@ class PushNotificationIOS {
'PushNotificationIOS only supports `notification` and `register` events'
);
if (type === 'notification') {
_notifHandlers[handler] = RCTDeviceEventEmitter.addListener(
_notifHandlers[String(handler)] = RCTDeviceEventEmitter.addListener(
DEVICE_NOTIF_EVENT,
(notifData) => {
handler(new PushNotificationIOS(notifData));
}
);
} else if (type === 'register') {
_notifHandlers[handler] = RCTDeviceEventEmitter.addListener(
_notifHandlers[String(handler)] = RCTDeviceEventEmitter.addListener(
NOTIF_REGISTER_EVENT,
(registrationInfo) => {
handler(registrationInfo.deviceToken);
@@ -143,11 +143,11 @@ class PushNotificationIOS {
type === 'notification' || type === 'register',
'PushNotificationIOS only supports `notification` and `register` events'
);
if (!_notifHandlers[handler]) {
if (!_notifHandlers[String(handler)]) {
return;
}
_notifHandlers[handler].remove();
_notifHandlers[handler] = null;
_notifHandlers[String(handler)].remove();
_notifHandlers[String(handler)] = null;
}