Skip to content

Commit c668fd5

Browse files
author
Brent Vatne
committed
[ReactNative] Add "RCTNativeAppEventEmitter"
Summary: As mentioned in #906, [in the docs it mentions sending native app events](http://facebook.github.io/react-native/docs/nativemodulesios.html#sending-events-to-javascript) eg: calendar event reminder received, through the `RCTNativeAppEventEmitter`, but the JS module for that is missing. This adds it - it's nothing more than an instance of `EventEmitter`, just like [RCTDeviceEventEmitter](https://github.com/facebook/react-native/blob/master/Libraries/Device/RCTDeviceEventEmitter.js). Closes facebook/react-native#918 Github Author: Brent Vatne <brent.vatne@madriska.com> Test Plan: Imported from GitHub, without a `Test Plan:` line.
1 parent 5f841a9 commit c668fd5

2 files changed

Lines changed: 19 additions & 0 deletions

File tree

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
/**
2+
* Copyright (c) 2015-present, Facebook, Inc.
3+
* All rights reserved.
4+
*
5+
* This source code is licensed under the BSD-style license found in the
6+
* LICENSE file in the root directory of this source tree. An additional grant
7+
* of patent rights can be found in the PATENTS file in the same directory.
8+
*
9+
* @providesModule RCTNativeAppEventEmitter
10+
* @flow
11+
*/
12+
'use strict';
13+
14+
var EventEmitter = require('EventEmitter');
15+
16+
var RCTNativeAppEventEmitter = new EventEmitter();
17+
18+
module.exports = RCTNativeAppEventEmitter;

Libraries/react-native/react-native.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ var ReactNative = Object.assign(Object.create(require('React')), {
5959

6060
// Plugins
6161
DeviceEventEmitter: require('RCTDeviceEventEmitter'),
62+
NativeAppEventEmitter: require('RCTNativeAppEventEmitter'),
6263
NativeModules: require('NativeModules'),
6364
requireNativeComponent: require('requireNativeComponent'),
6465

0 commit comments

Comments
 (0)