Skip to content

Commit

Permalink
Update Platform.web.js
Browse files Browse the repository at this point in the history
  • Loading branch information
EvanBacon committed Feb 12, 2019
1 parent dd344e6 commit 11b158c
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion Libraries/Utilities/Platform.web.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,15 @@

'use strict';

export type PlatformSelectSpec<D, I> = {
default?: D,
web?: I,
};

const Platform = {
OS: 'web',
select: (obj: Object) => ('web' in obj ? obj.web : obj.default),
select: <D, I>(spec: PlatformSelectSpec<D, I>): D | I =>
'web' in spec ? spec.web : spec.default,
};

module.exports = Platform;

0 comments on commit 11b158c

Please sign in to comment.