UNPKG

rx-winjs

Version:

Library for composing asynchronous and event-based operations in JavaScript extending the Windows WinJS library

12 lines (10 loc) 405 B
var compass = Windows.Devices.Sensors.Compass.getDefault(); Rx.WinJS.Compass = { /** * Creates a wrapper for the Compass which listens for the readingchanged event. * @returns {Observable} An observable sequence wrapping the Compass's readingchanged event. */ readingChanged: function () { return fromSensorEvent(compass, 'readingchanged'); } };