Files
react-native/Libraries/Utilities/Platform.android.js
T
Igor Avramovic c55e3649dd Lazy load platform specific code
Differential Revision: D3369528

fbshipit-source-id: 0fbc63fbac5e96468598fb3d0a86c6b20f96f39d
2016-06-02 17:43:25 -07:00

29 lines
678 B
JavaScript

/**
* 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 Platform
* @flow
*/
'use strict';
const Platform = {
OS: 'android',
get Version() { return require('NativeModules').AndroidConstants.Version; },
select: (obj: Object) => obj.android,
lazySelect(obj: ?Object): ?Object {
if (!obj || !obj.android) {
return null;
}
return obj.android();
},
};
module.exports = Platform;