rx-winjs
Version:
Library for composing asynchronous and event-based operations in JavaScript extending the Windows WinJS library
12 lines (10 loc) • 562 B
JavaScript
var simpleOrientationSensor = Windows.Devices.Sensors.SimpleOrientationSensor.getDefault();
Rx.WinJS.SimpleOrientationSensor = {
/**
* Creates a wrapper for the SimpleOrientationSensor which listens for the orientationchanged event.
* @returns {Observable} An observable sequence wrapping the SimpleOrientationSensor's orientationchanged event.
*/
orientationChanged: function (reportInterval) {
return fromSensorEvent(simpleOrientationSensor, 'orientationchanged');
}
};