@rxap/ngx-pub-sub 18.0.3-dev.0 → 18.0.3-dev.2
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/CHANGELOG.md +10 -0
- package/README.md +13 -0
- package/compodoc/changelog.html +7 -0
- package/compodoc/dependencies.html +2 -0
- package/compodoc/index.html +8 -1
- package/compodoc/injectables/PubSubService.html +22 -15
- package/compodoc/js/search/search_index.js +2 -2
- package/compodoc/miscellaneous/functions.html +72 -1
- package/compodoc/properties.html +1 -1
- package/docs/classes/MessageMetaData.html +11 -11
- package/docs/classes/PubSubService.html +8 -8
- package/docs/documentation.json +99 -83
- package/docs/functions/ProvidePubSub.html +1 -1
- package/docs/functions/withDisableCache.html +1 -1
- package/docs/functions/withDisableGarbageCollector.html +1 -1
- package/docs/functions/withGarbageCollectorInterval.html +1 -1
- package/docs/functions/withMaxCacheSize.html +1 -1
- package/docs/index.html +10 -1
- package/docs/interfaces/CachedPubSubMessage.html +3 -3
- package/docs/interfaces/PubSubMessage.html +3 -3
- package/docs/variables/RXAP_PUB_SUB_CACHE_SIZE.html +1 -1
- package/docs/variables/RXAP_PUB_SUB_DISABLE_CACHE.html +1 -1
- package/docs/variables/RXAP_PUB_SUB_DISABLE_GARBAGE_COLLECTOR.html +1 -1
- package/docs/variables/RXAP_PUB_SUB_GARBAGE_COLLECTOR_INTERVAL.html +1 -1
- package/esm2022/lib/pub-sub.service.mjs +11 -4
- package/fesm2022/rxap-ngx-pub-sub.mjs +10 -3
- package/fesm2022/rxap-ngx-pub-sub.mjs.map +1 -1
- package/package.json +4 -2
- package/theme.css +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,16 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## [18.0.3-dev.2](https://gitlab.com/rxap/packages/compare/@rxap/ngx-pub-sub@18.0.3-dev.1...@rxap/ngx-pub-sub@18.0.3-dev.2) (2024-06-26)
|
|
7
|
+
|
|
8
|
+
### Bug Fixes
|
|
9
|
+
|
|
10
|
+
- auto init the garbage collation ([58f2da8](https://gitlab.com/rxap/packages/commit/58f2da80e4f5a5b9f163fa20847c4dc210fda38b))
|
|
11
|
+
|
|
12
|
+
## [18.0.3-dev.1](https://gitlab.com/rxap/packages/compare/@rxap/ngx-pub-sub@18.0.3-dev.0...@rxap/ngx-pub-sub@18.0.3-dev.1) (2024-06-21)
|
|
13
|
+
|
|
14
|
+
**Note:** Version bump only for package @rxap/ngx-pub-sub
|
|
15
|
+
|
|
6
16
|
## [18.0.3-dev.0](https://gitlab.com/rxap/packages/compare/@rxap/ngx-pub-sub@18.0.2...@rxap/ngx-pub-sub@18.0.3-dev.0) (2024-06-20)
|
|
7
17
|
|
|
8
18
|
**Note:** Version bump only for package @rxap/ngx-pub-sub
|
package/README.md
CHANGED
|
@@ -8,6 +8,7 @@
|
|
|
8
8
|

|
|
9
9
|
|
|
10
10
|
- [Installation](#installation)
|
|
11
|
+
- [Generators](#generators)
|
|
11
12
|
|
|
12
13
|
# Installation
|
|
13
14
|
|
|
@@ -19,3 +20,15 @@ yarn add @rxap/ngx-pub-sub
|
|
|
19
20
|
```bash
|
|
20
21
|
yarn add @angular/core@^18.0.1 rxjs@^7.8.1
|
|
21
22
|
```
|
|
23
|
+
**Execute the init generator:**
|
|
24
|
+
```bash
|
|
25
|
+
yarn nx g @rxap/ngx-pub-sub:init
|
|
26
|
+
```
|
|
27
|
+
# Generators
|
|
28
|
+
|
|
29
|
+
## init
|
|
30
|
+
> Initialize the package in the workspace
|
|
31
|
+
|
|
32
|
+
```bash
|
|
33
|
+
yarn nx g @rxap/ngx-pub-sub:init
|
|
34
|
+
```
|
package/compodoc/changelog.html
CHANGED
|
@@ -85,6 +85,13 @@
|
|
|
85
85
|
<h1>Change Log</h1>
|
|
86
86
|
<p>All notable changes to this project will be documented in this file.
|
|
87
87
|
See <a href="https://conventionalcommits.org">Conventional Commits</a> for commit guidelines.</p>
|
|
88
|
+
<h2><a href="https://gitlab.com/rxap/packages/compare/@rxap/ngx-pub-sub@18.0.3-dev.1...@rxap/ngx-pub-sub@18.0.3-dev.2">18.0.3-dev.2</a> (2024-06-26)</h2>
|
|
89
|
+
<h3>Bug Fixes</h3>
|
|
90
|
+
<ul>
|
|
91
|
+
<li>auto init the garbage collation (<a href="https://gitlab.com/rxap/packages/commit/58f2da80e4f5a5b9f163fa20847c4dc210fda38b">58f2da8</a>)</li>
|
|
92
|
+
</ul>
|
|
93
|
+
<h2><a href="https://gitlab.com/rxap/packages/compare/@rxap/ngx-pub-sub@18.0.3-dev.0...@rxap/ngx-pub-sub@18.0.3-dev.1">18.0.3-dev.1</a> (2024-06-21)</h2>
|
|
94
|
+
<p><strong>Note:</strong> Version bump only for package @rxap/ngx-pub-sub</p>
|
|
88
95
|
<h2><a href="https://gitlab.com/rxap/packages/compare/@rxap/ngx-pub-sub@18.0.2...@rxap/ngx-pub-sub@18.0.3-dev.0">18.0.3-dev.0</a> (2024-06-20)</h2>
|
|
89
96
|
<p><strong>Note:</strong> Version bump only for package @rxap/ngx-pub-sub</p>
|
|
90
97
|
<h2><a href="https://gitlab.com/rxap/packages/compare/@rxap/ngx-pub-sub@18.0.2-dev.1...@rxap/ngx-pub-sub@18.0.2">18.0.2</a> (2024-06-18)</h2>
|
package/compodoc/index.html
CHANGED
|
@@ -91,11 +91,18 @@
|
|
|
91
91
|
<img src="https://img.shields.io/npm/l/@rxap/ngx-pub-sub" alt="NPM" class="img-responsive"></p>
|
|
92
92
|
<ul>
|
|
93
93
|
<li><a href="#installation">Installation</a></li>
|
|
94
|
+
<li><a href="#generators">Generators</a></li>
|
|
94
95
|
</ul>
|
|
95
96
|
<h1>Installation</h1>
|
|
96
97
|
<p><strong>Add the package to your workspace:</strong></p>
|
|
97
98
|
<b>Example :</b><div><pre class="line-numbers"><code class="language-bash">yarn add @rxap/ngx-pub-sub</code></pre></div><p><strong>Install peer dependencies:</strong></p>
|
|
98
|
-
<b>Example :</b><div><pre class="line-numbers"><code class="language-bash">yarn add @angular/core@^18.0.1 rxjs@^7.8.1 </code></pre></div>
|
|
99
|
+
<b>Example :</b><div><pre class="line-numbers"><code class="language-bash">yarn add @angular/core@^18.0.1 rxjs@^7.8.1 </code></pre></div><p><strong>Execute the init generator:</strong></p>
|
|
100
|
+
<b>Example :</b><div><pre class="line-numbers"><code class="language-bash">yarn nx g @rxap/ngx-pub-sub:init</code></pre></div><h1>Generators</h1>
|
|
101
|
+
<h2>init</h2>
|
|
102
|
+
<blockquote>
|
|
103
|
+
<p>Initialize the package in the workspace</p>
|
|
104
|
+
</blockquote>
|
|
105
|
+
<b>Example :</b><div><pre class="line-numbers"><code class="language-bash">yarn nx g @rxap/ngx-pub-sub:init</code></pre></div>
|
|
99
106
|
|
|
100
107
|
|
|
101
108
|
|
|
@@ -221,8 +221,8 @@
|
|
|
221
221
|
|
|
222
222
|
<tr>
|
|
223
223
|
<td class="col-md-4">
|
|
224
|
-
<div class="io-line">Defined in <a href="" data-line="
|
|
225
|
-
class="link-to-prism">src/lib/pub-sub.service.ts:
|
|
224
|
+
<div class="io-line">Defined in <a href="" data-line="199"
|
|
225
|
+
class="link-to-prism">src/lib/pub-sub.service.ts:199</a></div>
|
|
226
226
|
</td>
|
|
227
227
|
</tr>
|
|
228
228
|
|
|
@@ -325,8 +325,8 @@
|
|
|
325
325
|
|
|
326
326
|
<tr>
|
|
327
327
|
<td class="col-md-4">
|
|
328
|
-
<div class="io-line">Defined in <a href="" data-line="
|
|
329
|
-
class="link-to-prism">src/lib/pub-sub.service.ts:
|
|
328
|
+
<div class="io-line">Defined in <a href="" data-line="143"
|
|
329
|
+
class="link-to-prism">src/lib/pub-sub.service.ts:143</a></div>
|
|
330
330
|
</td>
|
|
331
331
|
</tr>
|
|
332
332
|
|
|
@@ -439,8 +439,8 @@
|
|
|
439
439
|
|
|
440
440
|
<tr>
|
|
441
441
|
<td class="col-md-4">
|
|
442
|
-
<div class="io-line">Defined in <a href="" data-line="
|
|
443
|
-
class="link-to-prism">src/lib/pub-sub.service.ts:
|
|
442
|
+
<div class="io-line">Defined in <a href="" data-line="77"
|
|
443
|
+
class="link-to-prism">src/lib/pub-sub.service.ts:77</a></div>
|
|
444
444
|
</td>
|
|
445
445
|
</tr>
|
|
446
446
|
|
|
@@ -586,8 +586,8 @@
|
|
|
586
586
|
|
|
587
587
|
<tr>
|
|
588
588
|
<td class="col-md-4">
|
|
589
|
-
<div class="io-line">Defined in <a href="" data-line="
|
|
590
|
-
class="link-to-prism">src/lib/pub-sub.service.ts:
|
|
589
|
+
<div class="io-line">Defined in <a href="" data-line="89"
|
|
590
|
+
class="link-to-prism">src/lib/pub-sub.service.ts:89</a></div>
|
|
591
591
|
</td>
|
|
592
592
|
</tr>
|
|
593
593
|
|
|
@@ -625,8 +625,8 @@
|
|
|
625
625
|
|
|
626
626
|
<tr>
|
|
627
627
|
<td class="col-md-4">
|
|
628
|
-
<div class="io-line">Defined in <a href="" data-line="
|
|
629
|
-
class="link-to-prism">src/lib/pub-sub.service.ts:
|
|
628
|
+
<div class="io-line">Defined in <a href="" data-line="173"
|
|
629
|
+
class="link-to-prism">src/lib/pub-sub.service.ts:173</a></div>
|
|
630
630
|
</td>
|
|
631
631
|
</tr>
|
|
632
632
|
|
|
@@ -724,8 +724,8 @@
|
|
|
724
724
|
|
|
725
725
|
<tr>
|
|
726
726
|
<td class="col-md-4">
|
|
727
|
-
<div class="io-line">Defined in <a href="" data-line="
|
|
728
|
-
class="link-to-prism">src/lib/pub-sub.service.ts:
|
|
727
|
+
<div class="io-line">Defined in <a href="" data-line="105"
|
|
728
|
+
class="link-to-prism">src/lib/pub-sub.service.ts:105</a></div>
|
|
729
729
|
</td>
|
|
730
730
|
</tr>
|
|
731
731
|
|
|
@@ -887,6 +887,10 @@ export class PubSubService implements OnDestroy {
|
|
|
887
887
|
|
|
888
888
|
public startGarbageCollector() {
|
|
889
889
|
this.garbageCollectorInitialized = true;
|
|
890
|
+
if (this.garbageCollectorInitialized) {
|
|
891
|
+
console.warn('Garbage collector is already initialized');
|
|
892
|
+
return;
|
|
893
|
+
}
|
|
890
894
|
if (this.disableGarbageCollector || this.disableCache) {
|
|
891
895
|
console.warn('Garbage collector is disabled');
|
|
892
896
|
return;
|
|
@@ -969,8 +973,9 @@ export class PubSubService implements OnDestroy {
|
|
|
969
973
|
public publish<T = unknown>(topic: string, data?: T, retention?: number): void {
|
|
970
974
|
|
|
971
975
|
if (!this.garbageCollectorInitialized) {
|
|
972
|
-
|
|
976
|
+
console.error(
|
|
973
977
|
'Garbage collector is not initialized. Ensure the ProvidePubSub function is called in the app config object');
|
|
978
|
+
this.startGarbageCollector();
|
|
974
979
|
}
|
|
975
980
|
|
|
976
981
|
if (!topic.trim().length) {
|
|
@@ -1002,8 +1007,9 @@ export class PubSubService implements OnDestroy {
|
|
|
1002
1007
|
}
|
|
1003
1008
|
|
|
1004
1009
|
if (!this.garbageCollectorInitialized) {
|
|
1005
|
-
|
|
1010
|
+
console.error(
|
|
1006
1011
|
'Garbage collector is not initialized. Ensure the ProvidePubSub function is called in the app config object');
|
|
1012
|
+
this.startGarbageCollector();
|
|
1007
1013
|
}
|
|
1008
1014
|
|
|
1009
1015
|
const fromCache = replayCount && replayCount > 0 ? this.getFromCache<T>(topic, replayCount ?? 0) : [];
|
|
@@ -1023,8 +1029,9 @@ export class PubSubService implements OnDestroy {
|
|
|
1023
1029
|
public getFromCache<T = unknown>(topic: string, limit = 0): Array<MessageMetaData<T>> {
|
|
1024
1030
|
|
|
1025
1031
|
if (!this.garbageCollectorInitialized) {
|
|
1026
|
-
|
|
1032
|
+
console.error(
|
|
1027
1033
|
'Garbage collector is not initialized. Ensure the ProvidePubSub function is called in the app config object');
|
|
1034
|
+
this.startGarbageCollector();
|
|
1028
1035
|
}
|
|
1029
1036
|
|
|
1030
1037
|
const messages: Array<MessageMetaData<T>> = [];
|