Compare commits
6 Commits
Author | SHA1 | Date | |
---|---|---|---|
d92123dcb9 | |||
5d8f569339 | |||
7168bd7ffd | |||
5031d28c32 | |||
4eaf91af3a | |||
511396894d |
4
package-lock.json
generated
4
package-lock.json
generated
@ -1,12 +1,12 @@
|
|||||||
{
|
{
|
||||||
"name": "@pushrocks/smartrx",
|
"name": "@pushrocks/smartrx",
|
||||||
"version": "2.0.21",
|
"version": "2.0.24",
|
||||||
"lockfileVersion": 2,
|
"lockfileVersion": 2,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
"name": "@pushrocks/smartrx",
|
"name": "@pushrocks/smartrx",
|
||||||
"version": "2.0.21",
|
"version": "2.0.24",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@pushrocks/lik": "^5.0.1",
|
"@pushrocks/lik": "^5.0.1",
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@pushrocks/smartrx",
|
"name": "@pushrocks/smartrx",
|
||||||
"version": "2.0.21",
|
"version": "2.0.24",
|
||||||
"private": false,
|
"private": false,
|
||||||
"description": "smart wrapper for rxjs",
|
"description": "smart wrapper for rxjs",
|
||||||
"main": "dist_ts/index.js",
|
"main": "dist_ts/index.js",
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
import * as plugins from './smartrx.plugins';
|
import * as plugins from './smartrx.plugins';
|
||||||
export * from './smartrx.classes.observablemap';
|
export * from './smartrx.classes.observablemap';
|
||||||
export * from './smartrx.classes.observableintake';
|
export * from './smartrx.classes.observableintake';
|
||||||
|
|
||||||
import * as rxjs from './smartrx.plugins.rxjs';
|
import * as rxjs from './smartrx.plugins.rxjs';
|
||||||
export { rxjs };
|
export {
|
||||||
|
rxjs
|
||||||
|
}
|
||||||
|
@ -1,10 +1,12 @@
|
|||||||
import * as plugins from './smartrx.plugins';
|
import * as plugins from './smartrx.plugins';
|
||||||
|
|
||||||
|
import * as rxjs from './smartrx.plugins.rxjs';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* ObservableIntake
|
* ObservableIntake
|
||||||
*/
|
*/
|
||||||
export class ObservableIntake<T> {
|
export class ObservableIntake<T> {
|
||||||
public observable: plugins.rxjs.Observable<T>;
|
public observable: rxjs.Observable<T>;
|
||||||
public completed: Promise<void>;
|
public completed: Promise<void>;
|
||||||
private completedDeffered: plugins.smartpromise.Deferred<void>;
|
private completedDeffered: plugins.smartpromise.Deferred<void>;
|
||||||
private observableFunctions: any = {
|
private observableFunctions: any = {
|
||||||
@ -20,7 +22,7 @@ export class ObservableIntake<T> {
|
|||||||
private payloadBuffer: any[] = [];
|
private payloadBuffer: any[] = [];
|
||||||
|
|
||||||
constructor() {
|
constructor() {
|
||||||
this.observable = plugins.rxjs.Observable.create((observerArg: plugins.rxjs.Observer<any>) => {
|
this.observable = rxjs.Observable.create((observerArg: rxjs.Observer<any>) => {
|
||||||
this.observableFunctions.next = (...args: any) => {
|
this.observableFunctions.next = (...args: any) => {
|
||||||
return observerArg.next(args);
|
return observerArg.next(args);
|
||||||
};
|
};
|
||||||
@ -33,7 +35,7 @@ export class ObservableIntake<T> {
|
|||||||
this.completed = this.completedDeffered.promise;
|
this.completed = this.completedDeffered.promise;
|
||||||
}
|
}
|
||||||
|
|
||||||
public setObservable(observableFunc: plugins.rxjs.Observable<any>) {
|
public setObservable(observableFunc: rxjs.Observable<any>) {
|
||||||
this.observable = observableFunc;
|
this.observable = observableFunc;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
import * as plugins from './smartrx.plugins';
|
import * as plugins from './smartrx.plugins';
|
||||||
|
import * as rxjs from './smartrx.plugins.rxjs';
|
||||||
|
|
||||||
export interface IEventEmitter<T = any> {
|
export interface IEventEmitter<T = any> {
|
||||||
on: (eventNameArg: string, eventHandlerArg: (eventPayload: T) => any) => void;
|
on: (eventNameArg: string, eventHandlerArg: (eventPayload: T) => any) => void;
|
||||||
@ -8,7 +9,7 @@ export interface IEventEmitter<T = any> {
|
|||||||
* bundles an observable with an emitter
|
* bundles an observable with an emitter
|
||||||
*/
|
*/
|
||||||
export interface IObservableEmitterBundle {
|
export interface IObservableEmitterBundle {
|
||||||
observable: plugins.rxjs.Observable<any>;
|
observable: rxjs.Observable<any>;
|
||||||
emitter: IEventEmitter<unknown>;
|
emitter: IEventEmitter<unknown>;
|
||||||
event: string;
|
event: string;
|
||||||
}
|
}
|
||||||
@ -30,7 +31,7 @@ export class Observablemap {
|
|||||||
if (existingBundle) {
|
if (existingBundle) {
|
||||||
return existingBundle.observable;
|
return existingBundle.observable;
|
||||||
} else {
|
} else {
|
||||||
const emitterObservable = plugins.rxjs.fromEvent<T>(emitterArg as any, eventArg);
|
const emitterObservable = rxjs.fromEvent<T>(emitterArg as any, eventArg);
|
||||||
this.observableEmitterBundleObjectmap.add({
|
this.observableEmitterBundleObjectmap.add({
|
||||||
observable: emitterObservable,
|
observable: emitterObservable,
|
||||||
emitter: emitterArg,
|
emitter: emitterArg,
|
||||||
|
@ -1,5 +1,4 @@
|
|||||||
import * as lik from '@pushrocks/lik';
|
import * as lik from '@pushrocks/lik';
|
||||||
import * as rxjs from './smartrx.plugins.rxjs';
|
|
||||||
import * as smartpromise from '@pushrocks/smartpromise';
|
import * as smartpromise from '@pushrocks/smartpromise';
|
||||||
|
|
||||||
export { lik, rxjs, smartpromise };
|
export { lik, smartpromise };
|
||||||
|
Reference in New Issue
Block a user