Skip to content

Commit

Permalink
define readonly getter for simulatorId
Browse files Browse the repository at this point in the history
  • Loading branch information
koenpunt committed Aug 2, 2017
1 parent a04e9f2 commit 45f1106
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
7 changes: 5 additions & 2 deletions RNAdMobBanner.js
Expand Up @@ -2,7 +2,6 @@ import React, { Component } from 'react';
import {
NativeModules,
requireNativeComponent,
Platform,
UIManager,
findNodeHandle,
ViewPropTypes,
Expand Down Expand Up @@ -61,7 +60,11 @@ class AdMobBanner extends Component {
}
}

AdMobBanner.simulatorId = Platform.OS === 'android' ? 'EMULATOR' : NativeModules.RNGADBannerViewManager.simulatorId;
Object.defineProperty(AdMobBanner, 'simulatorId', {
get() {
return NativeModules.RNGADBannerViewManager.simulatorId;
},
});

AdMobBanner.propTypes = {
...ViewPropTypes,
Expand Down
7 changes: 5 additions & 2 deletions RNPublisherBanner.js
Expand Up @@ -2,7 +2,6 @@ import React, { Component } from 'react';
import {
NativeModules,
requireNativeComponent,
Platform,
UIManager,
findNodeHandle,
ViewPropTypes,
Expand Down Expand Up @@ -70,7 +69,11 @@ class PublisherBanner extends Component {
}
}

PublisherBanner.simulatorId = Platform.OS === 'android' ? 'EMULATOR' : NativeModules.RNDFPBannerViewManager.simulatorId;
Object.defineProperty(PublisherBanner, 'simulatorId', {
get() {
return NativeModules.RNDFPBannerViewManager.simulatorId;
},
});

PublisherBanner.propTypes = {
...ViewPropTypes,
Expand Down

0 comments on commit 45f1106

Please sign in to comment.