universal-platform
v0.6.5
Published
A universal Platform API.
Downloads
154
Readme
universal-platform
Get runtime OS name
Install
$ npm install universal-platform --save
Usage
import {OS} from 'universal-platform';
// maybe iOS, Android, or Web
console.log(OS);
APIS
select(obj)
Use it to return platform specific component, like below:
import {select} from 'universal-platform';
import AndroidComponent from './AndroidComponent';
import IOSComponent from './IOSComponent';
const DestComponent = select({
iOS: IOSComponent,
Android: AndroidComponent
});