useNativeEvents

Determines whether the fromEventarrow-up-right method uses native DOM events only and disregards the referenced supported libraries such as jQueryarrow-up-right, Zepto.jsarrow-up-right, AngularJSarrow-up-right, Ember.jsarrow-up-right and Backbone.jsarrow-up-right

Example

For example, we could have jQuery referenced as part of our project, however, we only want native DOM events.

<script src="jquery.js"></script>
<script src="rx.lite.js"></script>

We can do this by setting the Rx.config.useNativeEvents flag to true.

Rx.config.useNativeEvents = true;

Rx.Observable.fromEvent(document, 'mousemove')
  .subscribe(e => console.log('ClientX: %d, ClientY: %d', e.clientX, e.clientY));

Last updated