redux-observable-es6-compat
Version:
This is build from redux-observable (https://github.com/redux-observable/redux-observable) but fix errors in es2015
28 lines (22 loc) • 598 B
JavaScript
import { Observable, of, from } from 'rxjs';
import { ofType } from './operators';
export class ActionsObservable extends Observable {
static of(...actions) {
return new this(of(...actions));
}
static from(actions, scheduler) {
return new this(from(actions, scheduler));
}
constructor(actionsSubject) {
super();
this.source = actionsSubject;
}
lift(operator) {
const observable = new ActionsObservable(this);
observable.operator = operator;
return observable;
}
ofType(...keys) {
return ofType(...keys)(this);
}
}