@fluixi/reactive 1.0.0-alpha.82 → 1.0.0-alpha.84

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.
Files changed (169) hide show
  1. package/README.md +4 -0
  2. package/dist/cdn/reactive.cjs +2673 -1
  3. package/dist/cdn/reactive.global.js +2 -1
  4. package/dist/cdn/reactive.mjs +2657 -1
  5. package/dist/cdn/signal.cjs +299 -1
  6. package/dist/cdn/signal.d.ts +1 -1
  7. package/dist/cdn/signal.global.js +2 -1
  8. package/dist/cdn/signal.js +1 -1
  9. package/dist/cdn/signal.mjs +276 -1
  10. package/dist/index.cjs +2673 -1
  11. package/dist/index.mjs +2657 -1
  12. package/dist/lib/index.cjs +2674 -1
  13. package/dist/lib/index.js +1 -1
  14. package/dist/lib/index.mjs +2659 -1
  15. package/dist/lib/observable/index.cjs +386 -1
  16. package/dist/lib/observable/index.mjs +364 -1
  17. package/dist/lib/observable/observable.cjs +384 -1
  18. package/dist/lib/observable/observable.d.ts +0 -137
  19. package/dist/lib/observable/observable.d.ts.map +1 -1
  20. package/dist/lib/observable/observable.js +0 -71
  21. package/dist/lib/observable/observable.mjs +361 -1
  22. package/dist/lib/observable/subscription.cjs +180 -1
  23. package/dist/lib/observable/subscription.d.ts +0 -12
  24. package/dist/lib/observable/subscription.d.ts.map +1 -1
  25. package/dist/lib/observable/subscription.js +0 -12
  26. package/dist/lib/observable/subscription.mjs +157 -1
  27. package/dist/lib/observable/types.cjs +18 -1
  28. package/dist/lib/observable/types.d.ts.map +1 -1
  29. package/dist/lib/predicates.cjs +44 -1
  30. package/dist/lib/predicates.d.ts +2 -2
  31. package/dist/lib/predicates.js +2 -2
  32. package/dist/lib/predicates.mjs +23 -1
  33. package/dist/lib/signal/api.cjs +571 -1
  34. package/dist/lib/signal/api.d.ts +211 -1
  35. package/dist/lib/signal/api.d.ts.map +1 -1
  36. package/dist/lib/signal/api.js +207 -12
  37. package/dist/lib/signal/api.mjs +548 -1
  38. package/dist/lib/signal/cached-resource.cjs +672 -1
  39. package/dist/lib/signal/cached-resource.d.ts +28 -16
  40. package/dist/lib/signal/cached-resource.d.ts.map +1 -1
  41. package/dist/lib/signal/cached-resource.js +35 -29
  42. package/dist/lib/signal/cached-resource.mjs +650 -1
  43. package/dist/lib/signal/graph/children.cjs +325 -1
  44. package/dist/lib/signal/graph/children.js +1 -1
  45. package/dist/lib/signal/graph/children.mjs +302 -1
  46. package/dist/lib/signal/graph/compat.cjs +578 -1
  47. package/dist/lib/signal/graph/compat.d.ts +13 -13
  48. package/dist/lib/signal/graph/compat.d.ts.map +1 -1
  49. package/dist/lib/signal/graph/compat.js +51 -32
  50. package/dist/lib/signal/graph/compat.mjs +556 -1
  51. package/dist/lib/signal/graph/core.cjs +295 -1
  52. package/dist/lib/signal/graph/core.d.ts +28 -24
  53. package/dist/lib/signal/graph/core.d.ts.map +1 -1
  54. package/dist/lib/signal/graph/core.js +45 -31
  55. package/dist/lib/signal/graph/core.mjs +273 -1
  56. package/dist/lib/signal/graph/debounced.cjs +668 -1
  57. package/dist/lib/signal/graph/debounced.d.ts +5 -5
  58. package/dist/lib/signal/graph/debounced.d.ts.map +1 -1
  59. package/dist/lib/signal/graph/debounced.js +5 -5
  60. package/dist/lib/signal/graph/debounced.mjs +645 -1
  61. package/dist/lib/signal/graph/derived.cjs +496 -1
  62. package/dist/lib/signal/graph/derived.d.ts +1 -1
  63. package/dist/lib/signal/graph/derived.js +1 -1
  64. package/dist/lib/signal/graph/derived.mjs +473 -1
  65. package/dist/lib/signal/graph/detect.cjs +66 -1
  66. package/dist/lib/signal/graph/detect.mjs +45 -1
  67. package/dist/lib/signal/graph/error-boundary.cjs +301 -1
  68. package/dist/lib/signal/graph/error-boundary.js +3 -3
  69. package/dist/lib/signal/graph/error-boundary.mjs +278 -1
  70. package/dist/lib/signal/graph/index.cjs +305 -1
  71. package/dist/lib/signal/graph/index.d.ts +7 -6
  72. package/dist/lib/signal/graph/index.d.ts.map +1 -1
  73. package/dist/lib/signal/graph/index.js +7 -6
  74. package/dist/lib/signal/graph/index.mjs +283 -1
  75. package/dist/lib/signal/graph/observe.cjs +163 -0
  76. package/dist/lib/signal/graph/observe.d.ts +141 -0
  77. package/dist/lib/signal/graph/observe.d.ts.map +1 -0
  78. package/dist/lib/signal/graph/observe.js +149 -0
  79. package/dist/lib/signal/graph/observe.mjs +140 -0
  80. package/dist/lib/signal/graph/resource.cjs +620 -1
  81. package/dist/lib/signal/graph/resource.d.ts +1 -1
  82. package/dist/lib/signal/graph/resource.js +7 -8
  83. package/dist/lib/signal/graph/resource.mjs +597 -1
  84. package/dist/lib/signal/graph/runtime.cjs +501 -1
  85. package/dist/lib/signal/graph/runtime.d.ts +9 -9
  86. package/dist/lib/signal/graph/runtime.d.ts.map +1 -1
  87. package/dist/lib/signal/graph/runtime.js +56 -37
  88. package/dist/lib/signal/graph/runtime.mjs +478 -1
  89. package/dist/lib/signal/graph/signal-next.cjs +1208 -1
  90. package/dist/lib/signal/graph/signal-next.d.ts +5 -5
  91. package/dist/lib/signal/graph/signal-next.d.ts.map +1 -1
  92. package/dist/lib/signal/graph/signal-next.js +14 -12
  93. package/dist/lib/signal/graph/signal-next.mjs +1186 -1
  94. package/dist/lib/signal/graph/ssr-hooks.cjs +60 -1
  95. package/dist/lib/signal/graph/ssr-hooks.d.ts +6 -7
  96. package/dist/lib/signal/graph/ssr-hooks.d.ts.map +1 -1
  97. package/dist/lib/signal/graph/ssr-hooks.js +6 -7
  98. package/dist/lib/signal/graph/ssr-hooks.mjs +39 -1
  99. package/dist/lib/signal/graph/state.cjs +72 -1
  100. package/dist/lib/signal/graph/state.d.ts +43 -10
  101. package/dist/lib/signal/graph/state.d.ts.map +1 -1
  102. package/dist/lib/signal/graph/state.js +83 -21
  103. package/dist/lib/signal/graph/state.mjs +49 -1
  104. package/dist/lib/signal/graph/suspense.cjs +301 -1
  105. package/dist/lib/signal/graph/suspense.js +4 -4
  106. package/dist/lib/signal/graph/suspense.mjs +278 -1
  107. package/dist/lib/signal/index-legacy.cjs +2540 -1
  108. package/dist/lib/signal/index-legacy.d.ts +1 -1
  109. package/dist/lib/signal/index-legacy.js +1 -1
  110. package/dist/lib/signal/index-legacy.mjs +2518 -1
  111. package/dist/lib/signal/index.cjs +1275 -1
  112. package/dist/lib/signal/index.d.ts +5 -2
  113. package/dist/lib/signal/index.d.ts.map +1 -1
  114. package/dist/lib/signal/index.js +8 -3
  115. package/dist/lib/signal/index.mjs +1253 -1
  116. package/dist/lib/signal/list.cjs +549 -1
  117. package/dist/lib/signal/list.d.ts +5 -5
  118. package/dist/lib/signal/list.js +10 -10
  119. package/dist/lib/signal/list.mjs +526 -1
  120. package/dist/lib/signal/resource-api.cjs +626 -1
  121. package/dist/lib/signal/resource-api.d.ts +5 -5
  122. package/dist/lib/signal/resource-api.js +5 -5
  123. package/dist/lib/signal/resource-api.mjs +603 -1
  124. package/dist/lib/signal/signal.cjs +2023 -1
  125. package/dist/lib/signal/signal.d.ts +4 -4
  126. package/dist/lib/signal/signal.d.ts.map +1 -1
  127. package/dist/lib/signal/signal.js +22 -23
  128. package/dist/lib/signal/signal.mjs +2000 -1
  129. package/dist/lib/signal/types.cjs +38 -1
  130. package/dist/lib/signal/types.d.ts.map +1 -1
  131. package/dist/lib/signal/types.js +2 -2
  132. package/dist/lib/signal/types.mjs +17 -1
  133. package/dist/lib/signal/utilities.cjs +1012 -1
  134. package/dist/lib/signal/utilities.d.ts +0 -108
  135. package/dist/lib/signal/utilities.d.ts.map +1 -1
  136. package/dist/lib/signal/utilities.js +0 -158
  137. package/dist/lib/signal/utilities.mjs +990 -1
  138. package/dist/lib/store/api.cjs +612 -1
  139. package/dist/lib/store/api.d.ts +33 -0
  140. package/dist/lib/store/api.d.ts.map +1 -1
  141. package/dist/lib/store/api.js +41 -8
  142. package/dist/lib/store/api.mjs +596 -1
  143. package/dist/lib/store/index.cjs +691 -1
  144. package/dist/lib/store/index.js +1 -1
  145. package/dist/lib/store/index.mjs +676 -1
  146. package/dist/lib/store/setter.types.cjs +18 -1
  147. package/dist/lib/store/setter.types.d.ts +43 -3
  148. package/dist/lib/store/setter.types.d.ts.map +1 -1
  149. package/dist/lib/store/store.cjs +658 -1
  150. package/dist/lib/store/store.d.ts +72 -0
  151. package/dist/lib/store/store.d.ts.map +1 -1
  152. package/dist/lib/store/store.js +294 -11
  153. package/dist/lib/store/store.mjs +644 -1
  154. package/dist/lib/store/types.cjs +18 -1
  155. package/dist/lib/store/types.d.ts +1 -1
  156. package/dist/lib/store/types.d.ts.map +1 -1
  157. package/dist/lib/store/utils.cjs +43 -1
  158. package/dist/lib/store/utils.d.ts +1 -1
  159. package/dist/lib/store/utils.js +1 -1
  160. package/dist/lib/store/utils.mjs +22 -1
  161. package/dist/lib/subject.cjs +450 -1
  162. package/dist/lib/subject.js +3 -91
  163. package/dist/lib/subject.mjs +427 -1
  164. package/dist/tsconfig.lib.tsbuildinfo +1 -1
  165. package/dist/version.generated.cjs +27 -1
  166. package/dist/version.generated.d.ts +1 -1
  167. package/dist/version.generated.js +2 -2
  168. package/dist/version.generated.mjs +7 -1
  169. package/package.json +5 -4
@@ -28,38 +28,26 @@ export declare class Subscription implements SubscriptionLike {
28
28
  /** @private */ private _subscriptions;
29
29
  /**
30
30
  * Creates a new Subscription.
31
- *
32
- * @param {Unsubscribable} [unsubscribe] - Optional cleanup function to call on unsubscribe
33
31
  */
34
32
  constructor(unsubscribe?: Unsubscribable);
35
33
  /**
36
34
  * Whether the subscription is closed.
37
- *
38
- * @returns {boolean} True if the subscription is closed
39
35
  */
40
36
  get closed(): boolean;
41
37
  /**
42
38
  * Disposes the resources held by the subscription.
43
39
  * May be called multiple times (idempotent).
44
- *
45
- * @returns {void}
46
40
  */
47
41
  unsubscribe(): void;
48
42
  /**
49
43
  * Adds a child subscription or cleanup function to this subscription.
50
44
  * When this subscription is unsubscribed, all added subscriptions/functions will be unsubscribed/called.
51
45
  *
52
- * @param {SubscriptionLike|Unsubscribable} subscription - Subscription or cleanup function to add
53
- * @returns {Subscription} This subscription for chaining
54
- *
55
46
  * @throws {TypeError} If the argument is not a subscription-like object or function
56
47
  */
57
48
  add(subscription: SubscriptionLike | Unsubscribable): this;
58
49
  /**
59
50
  * Removes a child subscription from this subscription.
60
- *
61
- * @param {Subscription} subscription - Subscription to remove
62
- * @returns {void}
63
51
  */
64
52
  remove(subscription: Subscription): void;
65
53
  /** @private */
@@ -1 +1 @@
1
- {"version":3,"file":"subscription.d.ts","sourceRoot":"","sources":["../../../src/lib/observable/subscription.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAiB,cAAc,EAAE,MAAM,YAAY,CAAC;AAE7E;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,qBAAa,YAAa,YAAW,gBAAgB;IACnD,eAAe,CAAC,OAAO,CAAC,OAAO,CAAS;IACxC,eAAe,CAAC,OAAO,CAAC,gBAAgB,CAGxB;IAChB,eAAe,CAAC,OAAO,CAAC,cAAc,CAEtB;IAEhB;;;;OAIG;gBACS,WAAW,CAAC,EAAE,cAAc;IAMxC;;;;OAIG;IACH,IAAI,MAAM,IAAI,OAAO,CAEpB;IAED;;;;;OAKG;IACH,WAAW,IAAI,IAAI;IAuCnB;;;;;;;;OAQG;IACH,GAAG,CAAC,YAAY,EAAE,gBAAgB,GAAG,cAAc,GAAG,IAAI;IA8C1D;;;;;OAKG;IACH,MAAM,CAAC,YAAY,EAAE,YAAY,GAAG,IAAI;IAexC,eAAe;IACf,OAAO,CAAC,UAAU;IAWlB,eAAe;IACf,OAAO,CAAC,aAAa;CActB"}
1
+ {"version":3,"file":"subscription.d.ts","sourceRoot":"","sources":["../../../src/lib/observable/subscription.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAiB,cAAc,EAAE,MAAM,YAAY,CAAC;AAE7E;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,qBAAa,YAAa,YAAW,gBAAgB;IACnD,eAAe,CAAC,OAAO,CAAC,OAAO,CAAS;IACxC,eAAe,CAAC,OAAO,CAAC,gBAAgB,CAGxB;IAChB,eAAe,CAAC,OAAO,CAAC,cAAc,CAEtB;IAEhB;;OAEG;gBACS,WAAW,CAAC,EAAE,cAAc;IAMxC;;OAEG;IACH,IAAI,MAAM,IAAI,OAAO,CAEpB;IAED;;;OAGG;IACH,WAAW,IAAI,IAAI;IAuCnB;;;;;OAKG;IACH,GAAG,CAAC,YAAY,EAAE,gBAAgB,GAAG,cAAc,GAAG,IAAI;IA8C1D;;OAEG;IACH,MAAM,CAAC,YAAY,EAAE,YAAY,GAAG,IAAI;IAexC,eAAe;IACf,OAAO,CAAC,UAAU;IAWlB,eAAe;IACf,OAAO,CAAC,aAAa;CActB"}
@@ -28,8 +28,6 @@ export class Subscription {
28
28
  /** @private */ _subscriptions = null;
29
29
  /**
30
30
  * Creates a new Subscription.
31
- *
32
- * @param {Unsubscribable} [unsubscribe] - Optional cleanup function to call on unsubscribe
33
31
  */
34
32
  constructor(unsubscribe) {
35
33
  if (unsubscribe) {
@@ -38,8 +36,6 @@ export class Subscription {
38
36
  }
39
37
  /**
40
38
  * Whether the subscription is closed.
41
- *
42
- * @returns {boolean} True if the subscription is closed
43
39
  */
44
40
  get closed() {
45
41
  return this._closed;
@@ -47,8 +43,6 @@ export class Subscription {
47
43
  /**
48
44
  * Disposes the resources held by the subscription.
49
45
  * May be called multiple times (idempotent).
50
- *
51
- * @returns {void}
52
46
  */
53
47
  unsubscribe() {
54
48
  if (this._closed) {
@@ -93,9 +87,6 @@ export class Subscription {
93
87
  * Adds a child subscription or cleanup function to this subscription.
94
88
  * When this subscription is unsubscribed, all added subscriptions/functions will be unsubscribed/called.
95
89
  *
96
- * @param {SubscriptionLike|Unsubscribable} subscription - Subscription or cleanup function to add
97
- * @returns {Subscription} This subscription for chaining
98
- *
99
90
  * @throws {TypeError} If the argument is not a subscription-like object or function
100
91
  */
101
92
  add(subscription) {
@@ -141,9 +132,6 @@ export class Subscription {
141
132
  }
142
133
  /**
143
134
  * Removes a child subscription from this subscription.
144
- *
145
- * @param {Subscription} subscription - Subscription to remove
146
- * @returns {void}
147
135
  */
148
136
  remove(subscription) {
149
137
  const { _subscriptions } = this;
@@ -1 +1,157 @@
1
- function e(i){return typeof i=="function"&&!/^class\s/.test(Function.prototype.toString.call(i))}function o(i){return i==null||Array.isArray(i)||typeof i=="function"||i instanceof Date||i instanceof RegExp||i instanceof Map||i instanceof Set||i instanceof Error?!1:typeof i=="object"}var c=class i{constructor(r){this._closed=!1;this._parentOrParents=null;this._subscriptions=null;r&&(this._subscriptions=[r])}get closed(){return this._closed}unsubscribe(){if(this._closed)return;this._closed=!0;let{_parentOrParents:r,_subscriptions:n}=this;if(r instanceof i)r.remove(this);else if(r!==null)for(let s of r)s.remove(this);if(n){for(let s of n)if(e(s)&&!(s instanceof i))try{s()}catch(t){console.error("Error in unsubscribe function:",t)}else if(o(s)&&typeof s.unsubscribe=="function")try{s.unsubscribe()}catch(t){console.error("Error unsubscribing child:",t)}this._subscriptions=null}}add(r){if(!r||r===this)return this;if(r.closed)return this;let{_closed:n,_subscriptions:s}=this;if(n){if(e(r))try{r()}catch(t){console.error("Error in unsubscribe function:",t)}else if(r.unsubscribe)try{r.unsubscribe()}catch(t){console.error("Error unsubscribing:",t)}return this}return s||(this._subscriptions=[]),this._subscriptions.push(r),r instanceof i&&r._addParent(this),this}remove(r){let{_subscriptions:n}=this;if(!n)return;let s=n.indexOf(r);s!==-1&&(n.splice(s,1),r._removeParent(this))}_addParent(r){let{_parentOrParents:n}=this;n?Array.isArray(n)?n.push(r):this._parentOrParents=[n,r]:this._parentOrParents=r}_removeParent(r){let{_parentOrParents:n}=this;if(n===r)this._parentOrParents=null;else if(Array.isArray(n)){let s=n.indexOf(r);s!==-1&&(n.splice(s,1),n.length===1&&(this._parentOrParents=n[0]))}}};export{c as Subscription};
1
+ // src/lib/predicates.ts
2
+ function isFunction(value) {
3
+ return typeof value === "function" && !/^class\s/.test(Function.prototype.toString.call(value));
4
+ }
5
+ function isObject(value) {
6
+ if (value == null) return false;
7
+ if (Array.isArray(value)) return false;
8
+ if (typeof value === "function") return false;
9
+ if (value instanceof Date) return false;
10
+ if (value instanceof RegExp) return false;
11
+ if (value instanceof Map) return false;
12
+ if (value instanceof Set) return false;
13
+ if (value instanceof Error) return false;
14
+ return typeof value === "object";
15
+ }
16
+
17
+ // src/lib/observable/subscription.ts
18
+ var Subscription = class _Subscription {
19
+ /**
20
+ * Creates a new Subscription.
21
+ */
22
+ constructor(unsubscribe) {
23
+ /** @private */
24
+ this._closed = false;
25
+ /** @private */
26
+ this._parentOrParents = null;
27
+ /** @private */
28
+ this._subscriptions = null;
29
+ if (unsubscribe) {
30
+ this._subscriptions = [unsubscribe];
31
+ }
32
+ }
33
+ /**
34
+ * Whether the subscription is closed.
35
+ */
36
+ get closed() {
37
+ return this._closed;
38
+ }
39
+ /**
40
+ * Disposes the resources held by the subscription.
41
+ * May be called multiple times (idempotent).
42
+ */
43
+ unsubscribe() {
44
+ if (this._closed) {
45
+ return;
46
+ }
47
+ this._closed = true;
48
+ const { _parentOrParents, _subscriptions } = this;
49
+ if (_parentOrParents instanceof _Subscription) {
50
+ _parentOrParents.remove(this);
51
+ } else if (_parentOrParents !== null) {
52
+ for (const parent of _parentOrParents) {
53
+ parent.remove(this);
54
+ }
55
+ }
56
+ if (_subscriptions) {
57
+ for (const sub of _subscriptions) {
58
+ if (isFunction(sub) && !(sub instanceof _Subscription)) {
59
+ try {
60
+ sub();
61
+ } catch (error) {
62
+ console.error("Error in unsubscribe function:", error);
63
+ }
64
+ } else if (isObject(sub) && typeof sub.unsubscribe === "function") {
65
+ try {
66
+ sub.unsubscribe();
67
+ } catch (error) {
68
+ console.error("Error unsubscribing child:", error);
69
+ }
70
+ }
71
+ }
72
+ this._subscriptions = null;
73
+ }
74
+ }
75
+ /**
76
+ * Adds a child subscription or cleanup function to this subscription.
77
+ * When this subscription is unsubscribed, all added subscriptions/functions will be unsubscribed/called.
78
+ *
79
+ * @throws {TypeError} If the argument is not a subscription-like object or function
80
+ */
81
+ add(subscription) {
82
+ if (!subscription || subscription === this) {
83
+ return this;
84
+ }
85
+ if (subscription.closed) {
86
+ return this;
87
+ }
88
+ let { _closed, _subscriptions } = this;
89
+ if (_closed) {
90
+ if (isFunction(subscription)) {
91
+ try {
92
+ subscription();
93
+ } catch (error) {
94
+ console.error("Error in unsubscribe function:", error);
95
+ }
96
+ } else if (subscription.unsubscribe) {
97
+ try {
98
+ subscription.unsubscribe();
99
+ } catch (error) {
100
+ console.error("Error unsubscribing:", error);
101
+ }
102
+ }
103
+ return this;
104
+ }
105
+ if (!_subscriptions) {
106
+ this._subscriptions = [];
107
+ }
108
+ this._subscriptions.push(subscription);
109
+ if (subscription instanceof _Subscription) {
110
+ subscription._addParent(this);
111
+ }
112
+ return this;
113
+ }
114
+ /**
115
+ * Removes a child subscription from this subscription.
116
+ */
117
+ remove(subscription) {
118
+ const { _subscriptions } = this;
119
+ if (!_subscriptions) {
120
+ return;
121
+ }
122
+ const index = _subscriptions.indexOf(subscription);
123
+ if (index !== -1) {
124
+ _subscriptions.splice(index, 1);
125
+ subscription._removeParent(this);
126
+ }
127
+ }
128
+ /** @private */
129
+ _addParent(parent) {
130
+ const { _parentOrParents } = this;
131
+ if (!_parentOrParents) {
132
+ this._parentOrParents = parent;
133
+ } else if (Array.isArray(_parentOrParents)) {
134
+ _parentOrParents.push(parent);
135
+ } else {
136
+ this._parentOrParents = [_parentOrParents, parent];
137
+ }
138
+ }
139
+ /** @private */
140
+ _removeParent(parent) {
141
+ const { _parentOrParents } = this;
142
+ if (_parentOrParents === parent) {
143
+ this._parentOrParents = null;
144
+ } else if (Array.isArray(_parentOrParents)) {
145
+ const index = _parentOrParents.indexOf(parent);
146
+ if (index !== -1) {
147
+ _parentOrParents.splice(index, 1);
148
+ if (_parentOrParents.length === 1) {
149
+ this._parentOrParents = _parentOrParents[0];
150
+ }
151
+ }
152
+ }
153
+ }
154
+ };
155
+ export {
156
+ Subscription
157
+ };
@@ -1 +1,18 @@
1
- "use strict";var t=Object.defineProperty;var v=Object.getOwnPropertyDescriptor;var p=Object.getOwnPropertyNames;var b=Object.prototype.hasOwnProperty;var c=(r,e,n,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of p(e))!b.call(r,o)&&o!==n&&t(r,o,{get:()=>e[o],enumerable:!(i=v(e,o))||i.enumerable});return r};var d=r=>c(t({},"__esModule",{value:!0}),r);var a={};module.exports=d(a);
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __copyProps = (to, from, except, desc) => {
7
+ if (from && typeof from === "object" || typeof from === "function") {
8
+ for (let key of __getOwnPropNames(from))
9
+ if (!__hasOwnProp.call(to, key) && key !== except)
10
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
11
+ }
12
+ return to;
13
+ };
14
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
15
+
16
+ // src/lib/observable/types.ts
17
+ var types_exports = {};
18
+ module.exports = __toCommonJS(types_exports);
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/lib/observable/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAEjD;;;;GAIG;AACH,MAAM,MAAM,cAAc,GAAG,MAAM,IAAI,CAAC;AAExC;;;;;;GAMG;AACH,MAAM,WAAW,gBAAgB;IAC7B,MAAM,EAAE,OAAO,CAAC;IAChB,WAAW,IAAI,IAAI,CAAC;CACvB;AAGD,MAAM,MAAM,aAAa,GAAG,YAAY,GAAG,cAAc,GAAG,CAAC,MAAM,IAAI,CAAC,GAAG,IAAI,CAAC;AAG9E;;GAEG;AACH,MAAM,WAAW,YAAY,CAAC,CAAC;IAC7B,IAAI,EAAE,CAAC,KAAK,EAAE,CAAC,KAAK,IAAI,CAAC;IACzB,KAAK,CAAC,EAAE,CAAC,KAAK,EAAE,GAAG,KAAK,IAAI,CAAC;IAC7B,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC;CACvB;AAED;;GAEG;AACH,MAAM,WAAW,aAAa,CAAC,CAAC;IAC9B,IAAI,CAAC,EAAE,CAAC,KAAK,EAAE,CAAC,KAAK,IAAI,CAAC;IAC1B,KAAK,EAAE,CAAC,KAAK,EAAE,GAAG,KAAK,IAAI,CAAC;IAC5B,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC;CACvB;AAED;;GAEG;AACH,MAAM,WAAW,kBAAkB,CAAC,CAAC;IACnC,IAAI,CAAC,EAAE,CAAC,KAAK,EAAE,CAAC,KAAK,IAAI,CAAC;IAC1B,KAAK,CAAC,EAAE,CAAC,KAAK,EAAE,GAAG,KAAK,IAAI,CAAC;IAC7B,QAAQ,EAAE,MAAM,IAAI,CAAC;CACtB"}
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/lib/observable/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAEjD;;;;GAIG;AACH,MAAM,MAAM,cAAc,GAAG,MAAM,IAAI,CAAC;AAExC;;;;;;GAMG;AACH,MAAM,WAAW,gBAAgB;IAC7B,MAAM,EAAE,OAAO,CAAC;IAChB,WAAW,IAAI,IAAI,CAAC;CACvB;AAED,MAAM,MAAM,aAAa,GAAG,YAAY,GAAG,cAAc,GAAG,CAAC,MAAM,IAAI,CAAC,GAAG,IAAI,CAAC;AAG9E;;GAEG;AACH,MAAM,WAAW,YAAY,CAAC,CAAC;IAC7B,IAAI,EAAE,CAAC,KAAK,EAAE,CAAC,KAAK,IAAI,CAAC;IACzB,KAAK,CAAC,EAAE,CAAC,KAAK,EAAE,GAAG,KAAK,IAAI,CAAC;IAC7B,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC;CACvB;AAED;;GAEG;AACH,MAAM,WAAW,aAAa,CAAC,CAAC;IAC9B,IAAI,CAAC,EAAE,CAAC,KAAK,EAAE,CAAC,KAAK,IAAI,CAAC;IAC1B,KAAK,EAAE,CAAC,KAAK,EAAE,GAAG,KAAK,IAAI,CAAC;IAC5B,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC;CACvB;AAED;;GAEG;AACH,MAAM,WAAW,kBAAkB,CAAC,CAAC;IACnC,IAAI,CAAC,EAAE,CAAC,KAAK,EAAE,CAAC,KAAK,IAAI,CAAC;IAC1B,KAAK,CAAC,EAAE,CAAC,KAAK,EAAE,GAAG,KAAK,IAAI,CAAC;IAC7B,QAAQ,EAAE,MAAM,IAAI,CAAC;CACtB"}
@@ -1 +1,44 @@
1
- "use strict";var e=Object.defineProperty;var f=Object.getOwnPropertyDescriptor;var s=Object.getOwnPropertyNames;var c=Object.prototype.hasOwnProperty;var u=(n,t)=>{for(var r in t)e(n,r,{get:t[r],enumerable:!0})},p=(n,t,r,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of s(t))!c.call(n,o)&&o!==r&&e(n,o,{get:()=>t[o],enumerable:!(i=f(t,o))||i.enumerable});return n};var a=n=>p(e({},"__esModule",{value:!0}),n);var x={};u(x,{isFunction:()=>y,isObject:()=>k,isPromise:()=>w});module.exports=a(x);function y(n){return typeof n=="function"&&!/^class\s/.test(Function.prototype.toString.call(n))}function k(n){return n==null||Array.isArray(n)||typeof n=="function"||n instanceof Date||n instanceof RegExp||n instanceof Map||n instanceof Set||n instanceof Error?!1:typeof n=="object"}function w(n){return n instanceof Promise||!!n&&(typeof n=="object"||typeof n=="function")&&"then"in n}
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+
20
+ // src/lib/predicates.ts
21
+ var predicates_exports = {};
22
+ __export(predicates_exports, {
23
+ isFunction: () => isFunction,
24
+ isObject: () => isObject,
25
+ isPromise: () => isPromise
26
+ });
27
+ module.exports = __toCommonJS(predicates_exports);
28
+ function isFunction(value) {
29
+ return typeof value === "function" && !/^class\s/.test(Function.prototype.toString.call(value));
30
+ }
31
+ function isObject(value) {
32
+ if (value == null) return false;
33
+ if (Array.isArray(value)) return false;
34
+ if (typeof value === "function") return false;
35
+ if (value instanceof Date) return false;
36
+ if (value instanceof RegExp) return false;
37
+ if (value instanceof Map) return false;
38
+ if (value instanceof Set) return false;
39
+ if (value instanceof Error) return false;
40
+ return typeof value === "object";
41
+ }
42
+ function isPromise(value) {
43
+ return value instanceof Promise || !!value && (typeof value === "object" || typeof value === "function") && "then" in value;
44
+ }
@@ -2,7 +2,7 @@
2
2
  * The type predicates this package needs, inlined.
3
3
  *
4
4
  * They came from `@fluixi/utils`, and the import was the only thing standing between
5
- * this package and being installable on its own a signals library that drags a
5
+ * this package and being installable on its own, a signals library that drags a
6
6
  * framework's utility package behind it reads as a framework component, whatever the
7
7
  * README says. Three predicates are not worth a dependency.
8
8
  *
@@ -22,7 +22,7 @@ export declare function isFunction<T extends Function = Function>(value: unknown
22
22
  * built-ins with their own identity.
23
23
  *
24
24
  * Date, RegExp, Map, Set and Error are excluded because a store must treat them as
25
- * opaque values rather than walking into them proxying a Date's internals produces
25
+ * opaque values rather than walking into them, proxying a Date's internals produces
26
26
  * an object that fails every method call on it.
27
27
  */
28
28
  export declare function isObject(value: unknown): value is Record<string | symbol, unknown>;
@@ -2,7 +2,7 @@
2
2
  * The type predicates this package needs, inlined.
3
3
  *
4
4
  * They came from `@fluixi/utils`, and the import was the only thing standing between
5
- * this package and being installable on its own a signals library that drags a
5
+ * this package and being installable on its own, a signals library that drags a
6
6
  * framework's utility package behind it reads as a framework component, whatever the
7
7
  * README says. Three predicates are not worth a dependency.
8
8
  *
@@ -25,7 +25,7 @@ export function isFunction(value) {
25
25
  * built-ins with their own identity.
26
26
  *
27
27
  * Date, RegExp, Map, Set and Error are excluded because a store must treat them as
28
- * opaque values rather than walking into them proxying a Date's internals produces
28
+ * opaque values rather than walking into them, proxying a Date's internals produces
29
29
  * an object that fails every method call on it.
30
30
  */
31
31
  export function isObject(value) {
@@ -1 +1,23 @@
1
- function t(n){return typeof n=="function"&&!/^class\s/.test(Function.prototype.toString.call(n))}function o(n){return n==null||Array.isArray(n)||typeof n=="function"||n instanceof Date||n instanceof RegExp||n instanceof Map||n instanceof Set||n instanceof Error?!1:typeof n=="object"}function r(n){return n instanceof Promise||!!n&&(typeof n=="object"||typeof n=="function")&&"then"in n}export{t as isFunction,o as isObject,r as isPromise};
1
+ // src/lib/predicates.ts
2
+ function isFunction(value) {
3
+ return typeof value === "function" && !/^class\s/.test(Function.prototype.toString.call(value));
4
+ }
5
+ function isObject(value) {
6
+ if (value == null) return false;
7
+ if (Array.isArray(value)) return false;
8
+ if (typeof value === "function") return false;
9
+ if (value instanceof Date) return false;
10
+ if (value instanceof RegExp) return false;
11
+ if (value instanceof Map) return false;
12
+ if (value instanceof Set) return false;
13
+ if (value instanceof Error) return false;
14
+ return typeof value === "object";
15
+ }
16
+ function isPromise(value) {
17
+ return value instanceof Promise || !!value && (typeof value === "object" || typeof value === "function") && "then" in value;
18
+ }
19
+ export {
20
+ isFunction,
21
+ isObject,
22
+ isPromise
23
+ };