cradova 3.4.0 → 3.4.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/dist/index.js +4 -1
- package/dist/primitives/classes.d.ts +2 -3
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -154,7 +154,7 @@ class Signal {
|
|
|
154
154
|
}
|
|
155
155
|
subscribe(eventName, comp) {
|
|
156
156
|
if (comp instanceof Comp) {
|
|
157
|
-
if (this.subs[eventName]
|
|
157
|
+
if (this.subs[eventName]?.find((cmp) => cmp.id === comp.id)) {
|
|
158
158
|
return;
|
|
159
159
|
}
|
|
160
160
|
if (!this.subs[eventName]) {
|
|
@@ -162,6 +162,9 @@ class Signal {
|
|
|
162
162
|
} else {
|
|
163
163
|
this.subs[eventName].push(comp);
|
|
164
164
|
}
|
|
165
|
+
if (this.pipe[eventName]) {
|
|
166
|
+
comp.subData = this.pipe[eventName];
|
|
167
|
+
}
|
|
165
168
|
}
|
|
166
169
|
}
|
|
167
170
|
clearPersist() {
|
|
@@ -72,13 +72,12 @@ export declare class Comp<Prop extends Record<string, any> = any> {
|
|
|
72
72
|
/**
|
|
73
73
|
* Cradova Signal
|
|
74
74
|
* ----
|
|
75
|
-
* Create
|
|
75
|
+
* Create a pub&sub store.
|
|
76
76
|
* Features:
|
|
77
77
|
* - create a store
|
|
78
78
|
* - subscribe components to events
|
|
79
|
-
* - set object keys instead of all values
|
|
80
79
|
* - persist changes to localStorage
|
|
81
|
-
* @constructor initial:
|
|
80
|
+
* @constructor initial: Record<string, any>, props: {persist}
|
|
82
81
|
*/
|
|
83
82
|
export declare class Signal<Type extends Record<string, any>> {
|
|
84
83
|
private pn?;
|