Skip to content

Commit

Permalink
chore(deps): update to Angular 6 and RxJs 6.1
Browse files Browse the repository at this point in the history
Adds compatibility for Angular 6 environments. Fixes #93, #94 

BREAKING CHANGE: This version is only compatible with Angular 6.
  • Loading branch information
JustACodeMonkey authored and grbsk committed May 24, 2018
1 parent c9d7ce5 commit 4a71953
Show file tree
Hide file tree
Showing 8 changed files with 10,307 additions and 358 deletions.
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
6.6.0
8.11.1
21 changes: 10 additions & 11 deletions modules/core/src/eventtargetinterruptsource.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,5 @@
import 'rxjs/add/operator/filter';
import 'rxjs/add/operator/throttleTime';
import 'rxjs/add/observable/fromEvent';
import 'rxjs/add/observable/merge';

import { Observable } from 'rxjs/Observable';
import { Subscription } from 'rxjs/Subscription';
import { Observable, Subscription, fromEvent, merge } from 'rxjs';
import { filter, throttleTime } from 'rxjs/operators';

import { InterruptArgs } from './interruptargs';
import { InterruptSource } from './interruptsource';
Expand Down Expand Up @@ -53,11 +48,15 @@ export class EventTargetInterruptSource extends InterruptSource {
this.passive = !!options.passive;

const opts = this.passive ? { passive: true } : null;
const fromEvents = events.split(' ').map(eventName => Observable.fromEvent<any>(target, eventName, opts));
this.eventSrc = Observable.merge(...fromEvents);
this.eventSrc = this.eventSrc.filter(innerArgs => !this.filterEvent(innerArgs));
const fromEvents = events.split(' ').map(eventName => fromEvent<any>(target, eventName, opts));
this.eventSrc = merge(...fromEvents);
this.eventSrc = this.eventSrc.pipe(
filter(innerArgs => !this.filterEvent(innerArgs))
);
if (this.throttleDelay > 0) {
this.eventSrc = this.eventSrc.throttleTime(this.throttleDelay);
this.eventSrc = this.eventSrc.pipe(
throttleTime(this.throttleDelay)
);
}

let handler = (innerArgs: any) => this.onInterrupt.emit(new InterruptArgs(this, innerArgs));
Expand Down
2 changes: 1 addition & 1 deletion modules/core/src/interrupt.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {Subscription} from 'rxjs/Subscription';
import {Subscription} from 'rxjs';

import {InterruptArgs} from './interruptargs';
import {InterruptSource} from './interruptsource';
Expand Down
1 change: 1 addition & 0 deletions modules/core/src/interruptsource.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { EventEmitter } from '@angular/core';

import { InterruptArgs } from './interruptargs';
import 'zone.js';

/*
* A base for classes that act as a source for interrupts.
Expand Down
Loading

0 comments on commit 4a71953

Please sign in to comment.