fix(core): update

This commit is contained in:
2019-09-10 18:03:46 +02:00
parent da6b7724b8
commit f9f0fc45e2
6 changed files with 24 additions and 12 deletions

View File

@ -1,9 +1,3 @@
export type IServerCallActions =
| 'channelSubscription'
| 'processMessage'
| 'channelUnsubscribe'
| 'terminateConnection';
export interface IServerUnsubscribeActionPayload {
name: string;
}

View File

@ -53,7 +53,7 @@ export class ClientUniverseChannel implements interfaces.IUniverseChannel {
* subscribes to a channel
* tells the universe about this instances interest into a channel
*/
public async subscribe(observerArg?: plugins.smartrx.rxjs.Observer<any>) {
public async subscribe(observingFunctionArg?: (messageArg: ClientUniverseMessage) => void) {
// lets make sure the channel is connected
if (this.status === 'unsubscribed') {
const response = await this.clientUniverseRef.smartsocketClient.serverCall<
@ -65,8 +65,10 @@ export class ClientUniverseChannel implements interfaces.IUniverseChannel {
this.status = response.subscriptionStatus;
}
if (observerArg) {
return this.subject.subscribe(observerArg);
if (observingFunctionArg) {
return this.subject.subscribe(messageArg => {
observingFunctionArg(messageArg);
},error => console.log);
}
}

View File

@ -1,3 +1,5 @@
import * as plugins from './smartuniverse.plugins';
export class ReactionResponse {}
export class ReactionResponse {
}

View File

@ -117,7 +117,7 @@ export class UniverseChannel {
public async push(messageArg: UniverseMessage) {
this.subject.next(messageArg);
const universeConnectionsWithChannelAccess: UniverseConnection[] = [];
this.universeRef.universeCache.connectionMap.forEach(async socketConnection => {
await this.universeRef.universeCache.connectionMap.forEach(async socketConnection => {
if (socketConnection.authenticatedChannels.includes(this)) {
universeConnectionsWithChannelAccess.push(socketConnection);
}

View File

@ -26,6 +26,7 @@ export class UniverseConnection {
universeConnection
);
universeRef.universeCache.connectionMap.add(universeConnection);
console.log('hi')
}
/**