Skip to content

Commit

Permalink
[ReactNative] Add "RCTNativeAppEventEmitter"
Browse files Browse the repository at this point in the history
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 #918
Github Author: Brent Vatne <[email protected]>

Test Plan: Imported from GitHub, without a `Test Plan:` line.
  • Loading branch information
Brent Vatne committed May 16, 2015
1 parent 5f841a9 commit c668fd5
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
18 changes: 18 additions & 0 deletions Libraries/NativeApp/RCTNativeAppEventEmitter.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
/**
* Copyright (c) 2015-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
* @providesModule RCTNativeAppEventEmitter
* @flow
*/
'use strict';

var EventEmitter = require('EventEmitter');

var RCTNativeAppEventEmitter = new EventEmitter();

module.exports = RCTNativeAppEventEmitter;
1 change: 1 addition & 0 deletions Libraries/react-native/react-native.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ var ReactNative = Object.assign(Object.create(require('React')), {

// Plugins
DeviceEventEmitter: require('RCTDeviceEventEmitter'),
NativeAppEventEmitter: require('RCTNativeAppEventEmitter'),
NativeModules: require('NativeModules'),
requireNativeComponent: require('requireNativeComponent'),

Expand Down

0 comments on commit c668fd5

Please sign in to comment.