Permalink
Switch branches/tags
Nothing to show
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
11 lines (8 sloc) 388 Bytes
var {NativeModules, NativeEventEmitter} = require('react-native');
var {DeviceBattery} = NativeModules;
const batteryEventEmitter = new NativeEventEmitter(DeviceBattery);
export default {
isCharging: DeviceBattery.isCharging,
getBatteryLevel: DeviceBattery.getBatteryLevel,
addListener: callback => batteryEventEmitter.addListener(DeviceBattery.BATTERY_CHANGE_EVENT, callback)
};