Skip to content

Commit 5ee27ff

Browse files
Brian Shinfacebook-github-bot
Brian Shin
authored andcommitted
Fork Platform with a modified API
Reviewed By: sahrens Differential Revision: D6501208 fbshipit-source-id: c4dbe9d5491f2d42e1a84a61758025e5b2dfa0fe
1 parent e76abfa commit 5ee27ff

File tree

2 files changed

+50
-0
lines changed

2 files changed

+50
-0
lines changed
+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
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 PlatformOS
10+
* @flow
11+
*/
12+
13+
'use strict';
14+
15+
export type PlatformSelectSpec<A, I> = {|
16+
android: A,
17+
ios: I,
18+
|};
19+
20+
const PlatformOS = {
21+
OS: 'android',
22+
select: <A, I> (spec: PlatformSelectSpec<A, I>): A | I => spec.android,
23+
};
24+
25+
module.exports = PlatformOS;

Libraries/Utilities/PlatformOS.ios.js

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
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 PlatformOS
10+
* @flow
11+
*/
12+
13+
'use strict';
14+
15+
export type PlatformSelectSpec<A, I> = {|
16+
android: A,
17+
ios: I,
18+
|};
19+
20+
const PlatformOS = {
21+
OS: 'ios',
22+
select: <A, I> (spec: PlatformSelectSpec<A, I>): A | I => spec.ios,
23+
};
24+
25+
module.exports = PlatformOS;

0 commit comments

Comments
 (0)