@senior-gestao-empresarial/angular-components 6.7.1 → 6.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bundles/senior-gestao-empresarial-angular-components.umd.js +29 -8
- package/bundles/senior-gestao-empresarial-angular-components.umd.js.map +1 -1
- package/bundles/senior-gestao-empresarial-angular-components.umd.min.js +1 -1
- package/bundles/senior-gestao-empresarial-angular-components.umd.min.js.map +1 -1
- package/components/websocket/websocket.service.d.ts +9 -0
- package/esm2015/components/websocket/websocket.service.js +31 -11
- package/esm5/components/websocket/websocket.service.js +32 -11
- package/fesm2015/senior-gestao-empresarial-angular-components.js +28 -8
- package/fesm2015/senior-gestao-empresarial-angular-components.js.map +1 -1
- package/fesm5/senior-gestao-empresarial-angular-components.js +29 -8
- package/fesm5/senior-gestao-empresarial-angular-components.js.map +1 -1
- package/package.json +1 -1
- package/senior-gestao-empresarial-angular-components.metadata.json +1 -1
|
@@ -7233,6 +7233,18 @@
|
|
|
7233
7233
|
WebsocketService.prototype.onReconnect = function () {
|
|
7234
7234
|
return this.reconnect$.asObservable();
|
|
7235
7235
|
};
|
|
7236
|
+
/**
|
|
7237
|
+
* Observable responsável por emitir uma notificação após o subscribe do evento.
|
|
7238
|
+
* @return Um `Observable<void>` que emite uma notificação após o subscribe do evento.
|
|
7239
|
+
*/
|
|
7240
|
+
WebsocketService.prototype.onSubscribe = function (_a) {
|
|
7241
|
+
var domain = _a.domain, service = _a.service, primitive = _a.primitive;
|
|
7242
|
+
var primitiveManager = this.primitiveManagers.get(this.getPrimitiveManagerKey(domain, service, primitive));
|
|
7243
|
+
if (!primitiveManager) {
|
|
7244
|
+
throw new Error("No subscription found for " + this.getPrimitiveManagerKey(domain, service, primitive));
|
|
7245
|
+
}
|
|
7246
|
+
return primitiveManager.subscribe$.asObservable();
|
|
7247
|
+
};
|
|
7236
7248
|
/**
|
|
7237
7249
|
* Observable responsável por emitir uma notificação quando ocorre algum erro.
|
|
7238
7250
|
* @return Um `Observable<FrameImpl>` que emite uma notificação quando ocorre algum erro.
|
|
@@ -7253,19 +7265,22 @@
|
|
|
7253
7265
|
var domain = options.domain, service = options.service, primitive = options.primitive;
|
|
7254
7266
|
var key = this.getPrimitiveManagerKey(domain, service, primitive);
|
|
7255
7267
|
if (this.primitiveManagers.has(key)) {
|
|
7256
|
-
return this.primitiveManagers.get(key).
|
|
7268
|
+
return this.primitiveManagers.get(key).event$.asObservable();
|
|
7257
7269
|
}
|
|
7258
7270
|
var primitiveManager = {
|
|
7259
7271
|
domain: domain,
|
|
7260
7272
|
service: service,
|
|
7261
7273
|
primitive: primitive,
|
|
7262
7274
|
stompSubscriptions: [],
|
|
7263
|
-
|
|
7275
|
+
event$: new rxjs.Subject(),
|
|
7276
|
+
subscribe$: new rxjs.ReplaySubject(1)
|
|
7264
7277
|
};
|
|
7265
7278
|
this.primitiveManagers.set(key, primitiveManager);
|
|
7266
7279
|
if (this.isConnected()) {
|
|
7267
7280
|
this.createStompSubscriptions(primitiveManager);
|
|
7268
|
-
return primitiveManager.
|
|
7281
|
+
return primitiveManager.event$
|
|
7282
|
+
.asObservable()
|
|
7283
|
+
.pipe(operators.finalize(function () { return _this.disconnectPrimitiveOnFinalize(primitiveManager); }));
|
|
7269
7284
|
}
|
|
7270
7285
|
else {
|
|
7271
7286
|
if (!this.isConnecting) {
|
|
@@ -7274,7 +7289,9 @@
|
|
|
7274
7289
|
this.connect$.pipe(operators.first()).subscribe(function () {
|
|
7275
7290
|
_this.createStompSubscriptions(primitiveManager);
|
|
7276
7291
|
});
|
|
7277
|
-
return primitiveManager.
|
|
7292
|
+
return primitiveManager.event$
|
|
7293
|
+
.asObservable()
|
|
7294
|
+
.pipe(operators.finalize(function () { return _this.disconnectPrimitiveOnFinalize(primitiveManager); }));
|
|
7278
7295
|
}
|
|
7279
7296
|
};
|
|
7280
7297
|
/** @private */
|
|
@@ -7284,6 +7301,7 @@
|
|
|
7284
7301
|
var withoutTokenUrl = this.getSubscriptionUrlWithoutToken(primitiveManager.domain, primitiveManager.service, primitiveManager.primitive);
|
|
7285
7302
|
var stompSubscriptionWithoutToken = this.createStompSubscription(withoutTokenUrl, primitiveManager);
|
|
7286
7303
|
primitiveManager.stompSubscriptions = [stompSubscriptionWithToken, stompSubscriptionWithoutToken];
|
|
7304
|
+
primitiveManager.subscribe$.next();
|
|
7287
7305
|
};
|
|
7288
7306
|
/** @private */
|
|
7289
7307
|
WebsocketService.prototype.connect = function () {
|
|
@@ -7349,7 +7367,8 @@
|
|
|
7349
7367
|
try {
|
|
7350
7368
|
for (var _h = __values(this.primitiveManagers.values()), _j = _h.next(); !_j.done; _j = _h.next()) {
|
|
7351
7369
|
var primitiveManager = _j.value;
|
|
7352
|
-
primitiveManager.
|
|
7370
|
+
primitiveManager.event$.complete();
|
|
7371
|
+
primitiveManager.subscribe$.complete();
|
|
7353
7372
|
}
|
|
7354
7373
|
}
|
|
7355
7374
|
catch (e_3_1) { e_3 = { error: e_3_1 }; }
|
|
@@ -7390,7 +7409,7 @@
|
|
|
7390
7409
|
WebsocketService.prototype.createStompSubscription = function (destination, primitiveManager) {
|
|
7391
7410
|
return this._stompClient.subscribe(destination, function (message) {
|
|
7392
7411
|
var event = JSON.parse(message.body || "{}");
|
|
7393
|
-
primitiveManager.
|
|
7412
|
+
primitiveManager.event$.next(event);
|
|
7394
7413
|
});
|
|
7395
7414
|
};
|
|
7396
7415
|
/** @private */
|
|
@@ -7453,7 +7472,7 @@
|
|
|
7453
7472
|
try {
|
|
7454
7473
|
for (var _b = __values(this.primitiveManagers.values()), _c = _b.next(); !_c.done; _c = _b.next()) {
|
|
7455
7474
|
var primitiveManager = _c.value;
|
|
7456
|
-
observersCount += primitiveManager.
|
|
7475
|
+
observersCount += primitiveManager.event$.observers.length;
|
|
7457
7476
|
}
|
|
7458
7477
|
}
|
|
7459
7478
|
catch (e_6_1) { e_6 = { error: e_6_1 }; }
|
|
@@ -7469,9 +7488,11 @@
|
|
|
7469
7488
|
WebsocketService.prototype.disconnectPrimitiveOnFinalize = function (primitiveManager) {
|
|
7470
7489
|
var e_7, _a;
|
|
7471
7490
|
// @IMPORTANT: Replace .observers.length === 1 with .observed in rxjs 7.0+
|
|
7472
|
-
var hasObservers = !(primitiveManager.
|
|
7491
|
+
var hasObservers = !(primitiveManager.event$.observers.length === 1);
|
|
7473
7492
|
if (hasObservers)
|
|
7474
7493
|
return;
|
|
7494
|
+
primitiveManager.event$.complete();
|
|
7495
|
+
primitiveManager.subscribe$.complete();
|
|
7475
7496
|
try {
|
|
7476
7497
|
for (var _b = __values(primitiveManager.stompSubscriptions), _c = _b.next(); !_c.done; _c = _b.next()) {
|
|
7477
7498
|
var stompSubscription = _c.value;
|