@blac/core 2.0.0-rc-16 → 2.0.0-rc.1
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/.tsbuildinfo +1 -0
- package/dist/Blac.d.ts +246 -0
- package/dist/Blac.d.ts.map +1 -0
- package/dist/Blac.js +624 -0
- package/dist/Blac.js.map +1 -0
- package/dist/Bloc.d.ts +41 -0
- package/dist/Bloc.d.ts.map +1 -0
- package/dist/Bloc.js +140 -0
- package/dist/Bloc.js.map +1 -0
- package/dist/BlocBase.d.ts +110 -0
- package/dist/BlocBase.d.ts.map +1 -0
- package/dist/BlocBase.js +287 -0
- package/dist/BlocBase.js.map +1 -0
- package/dist/Cubit.d.ts +25 -0
- package/dist/Cubit.d.ts.map +1 -0
- package/dist/Cubit.js +64 -0
- package/dist/Cubit.js.map +1 -0
- package/dist/adapter/BlacAdapter.d.ts +67 -0
- package/dist/adapter/BlacAdapter.d.ts.map +1 -0
- package/dist/adapter/BlacAdapter.js +263 -0
- package/dist/adapter/BlacAdapter.js.map +1 -0
- package/dist/adapter/ProxyFactory.d.ts +50 -0
- package/dist/adapter/ProxyFactory.d.ts.map +1 -0
- package/dist/adapter/ProxyFactory.js +150 -0
- package/dist/adapter/ProxyFactory.js.map +1 -0
- package/{src/adapter/index.ts → dist/adapter/index.d.ts} +1 -0
- package/dist/adapter/index.d.ts.map +1 -0
- package/dist/adapter/index.js +19 -0
- package/dist/adapter/index.js.map +1 -0
- package/dist/errors/BlacError.d.ts +38 -0
- package/dist/errors/BlacError.d.ts.map +1 -0
- package/dist/errors/BlacError.js +55 -0
- package/dist/errors/BlacError.js.map +1 -0
- package/dist/errors/ErrorManager.d.ts +39 -0
- package/dist/errors/ErrorManager.d.ts.map +1 -0
- package/dist/errors/ErrorManager.js +91 -0
- package/dist/errors/ErrorManager.js.map +1 -0
- package/dist/errors/handleError.d.ts +24 -0
- package/dist/errors/handleError.d.ts.map +1 -0
- package/dist/errors/handleError.js +62 -0
- package/dist/errors/handleError.js.map +1 -0
- package/dist/errors/index.d.ts +5 -0
- package/dist/errors/index.d.ts.map +1 -0
- package/dist/errors/index.js +13 -0
- package/dist/errors/index.js.map +1 -0
- package/{src/events.ts → dist/events.d.ts} +4 -2
- package/dist/events.d.ts.map +1 -0
- package/dist/events.js +17 -0
- package/dist/events.js.map +1 -0
- package/dist/index.cjs +38 -0
- package/{src/index.ts → dist/index.d.ts} +1 -10
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +38 -0
- package/dist/index.js.map +1 -0
- package/dist/lifecycle/BlocLifecycle.d.ts +51 -0
- package/dist/lifecycle/BlocLifecycle.d.ts.map +1 -0
- package/dist/lifecycle/BlocLifecycle.js +123 -0
- package/dist/lifecycle/BlocLifecycle.js.map +1 -0
- package/dist/lifecycle/index.d.ts +2 -0
- package/dist/lifecycle/index.d.ts.map +1 -0
- package/dist/lifecycle/index.js +18 -0
- package/dist/lifecycle/index.js.map +1 -0
- package/dist/plugins/BlocPluginRegistry.d.ts +58 -0
- package/dist/plugins/BlocPluginRegistry.d.ts.map +1 -0
- package/dist/plugins/BlocPluginRegistry.js +201 -0
- package/dist/plugins/BlocPluginRegistry.js.map +1 -0
- package/dist/plugins/SystemPluginRegistry.d.ts +79 -0
- package/dist/plugins/SystemPluginRegistry.d.ts.map +1 -0
- package/dist/plugins/SystemPluginRegistry.js +184 -0
- package/dist/plugins/SystemPluginRegistry.js.map +1 -0
- package/{src/plugins/index.ts → dist/plugins/index.d.ts} +1 -5
- package/dist/plugins/index.d.ts.map +1 -0
- package/dist/plugins/index.js +26 -0
- package/dist/plugins/index.js.map +1 -0
- package/dist/plugins/types.d.ts +103 -0
- package/dist/plugins/types.d.ts.map +1 -0
- package/dist/plugins/types.js +3 -0
- package/dist/plugins/types.js.map +1 -0
- package/dist/subscription/SubscriptionManager.d.ts +67 -0
- package/dist/subscription/SubscriptionManager.d.ts.map +1 -0
- package/dist/subscription/SubscriptionManager.js +317 -0
- package/dist/subscription/SubscriptionManager.js.map +1 -0
- package/{src/subscription/index.ts → dist/subscription/index.d.ts} +1 -0
- package/dist/subscription/index.d.ts.map +1 -0
- package/dist/subscription/index.js +19 -0
- package/dist/subscription/index.js.map +1 -0
- package/dist/subscription/types.d.ts +65 -0
- package/dist/subscription/types.d.ts.map +1 -0
- package/dist/subscription/types.js +3 -0
- package/dist/subscription/types.js.map +1 -0
- package/dist/testing.d.ts +33 -0
- package/dist/testing.d.ts.map +1 -0
- package/dist/testing.js +68 -0
- package/dist/testing.js.map +1 -0
- package/{src/types.ts → dist/types.d.ts} +11 -28
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +3 -0
- package/dist/types.js.map +1 -0
- package/dist/utils/BatchingManager.d.ts +28 -0
- package/dist/utils/BatchingManager.d.ts.map +1 -0
- package/dist/utils/BatchingManager.js +48 -0
- package/dist/utils/BatchingManager.js.map +1 -0
- package/dist/utils/RerenderLogger.d.ts +60 -0
- package/dist/utils/RerenderLogger.d.ts.map +1 -0
- package/dist/utils/RerenderLogger.js +205 -0
- package/dist/utils/RerenderLogger.js.map +1 -0
- package/dist/utils/generateInstanceId.d.ts +11 -0
- package/dist/utils/generateInstanceId.d.ts.map +1 -0
- package/dist/utils/generateInstanceId.js +50 -0
- package/dist/utils/generateInstanceId.js.map +1 -0
- package/dist/utils/shallowEqual.d.ts +9 -0
- package/dist/utils/shallowEqual.d.ts.map +1 -0
- package/dist/utils/shallowEqual.js +35 -0
- package/dist/utils/shallowEqual.js.map +1 -0
- package/dist/utils/uuid.d.ts +10 -0
- package/dist/utils/uuid.d.ts.map +1 -0
- package/dist/utils/uuid.js +24 -0
- package/dist/utils/uuid.js.map +1 -0
- package/package.json +19 -6
- package/src/Blac.ts +0 -802
- package/src/Bloc.ts +0 -180
- package/src/BlocBase.ts +0 -398
- package/src/Cubit.ts +0 -68
- package/src/__tests__/Blac.config.test.ts +0 -79
- package/src/__tests__/Bloc.event.test.ts +0 -394
- package/src/__tests__/BlocBase.subscription.test.ts +0 -349
- package/src/__tests__/Cubit.test.ts +0 -462
- package/src/__tests__/memory-leaks.test.ts +0 -383
- package/src/__tests__/plugins.test.ts +0 -464
- package/src/adapter/BlacAdapter.ts +0 -467
- package/src/adapter/ProxyFactory.ts +0 -249
- package/src/adapter/__tests__/BlacAdapter.test.ts +0 -555
- package/src/adapter/__tests__/ProxyFactory.test.ts +0 -655
- package/src/errors/BlacError.ts +0 -69
- package/src/errors/ErrorManager.ts +0 -101
- package/src/errors/handleError.ts +0 -114
- package/src/errors/index.ts +0 -13
- package/src/lifecycle/BlocLifecycle.ts +0 -156
- package/src/lifecycle/index.ts +0 -1
- package/src/plugins/BlocPluginRegistry.ts +0 -240
- package/src/plugins/SystemPluginRegistry.ts +0 -242
- package/src/plugins/__tests__/BlocPluginRegistry.test.ts +0 -450
- package/src/plugins/__tests__/SystemPluginRegistry.test.ts +0 -404
- package/src/plugins/types.ts +0 -129
- package/src/subscription/README.md +0 -132
- package/src/subscription/SubscriptionManager.ts +0 -395
- package/src/subscription/__tests__/SubscriptionManager.test.ts +0 -355
- package/src/subscription/types.ts +0 -90
- package/src/testing.ts +0 -246
- package/src/utils/BatchingManager.ts +0 -59
- package/src/utils/RerenderLogger.ts +0 -265
- package/src/utils/__tests__/generateInstanceId.test.ts +0 -104
- package/src/utils/__tests__/shallowEqual.test.ts +0 -171
- package/src/utils/__tests__/uuid.test.ts +0 -144
- package/src/utils/generateInstanceId.ts +0 -54
- package/src/utils/shallowEqual.ts +0 -40
- package/src/utils/uuid.ts +0 -22
|
@@ -0,0 +1,317 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SubscriptionManager = void 0;
|
|
4
|
+
const Blac_1 = require("../Blac");
|
|
5
|
+
const uuid_1 = require("../utils/uuid");
|
|
6
|
+
/**
|
|
7
|
+
* Unified subscription manager that replaces the dual consumer/observer system.
|
|
8
|
+
* Handles all state change subscriptions with a single, consistent interface.
|
|
9
|
+
*/
|
|
10
|
+
class SubscriptionManager {
|
|
11
|
+
bloc;
|
|
12
|
+
subscriptions = new Map();
|
|
13
|
+
pathToSubscriptions = new Map();
|
|
14
|
+
weakRefCleanupScheduled = false;
|
|
15
|
+
totalNotifications = 0;
|
|
16
|
+
constructor(bloc) {
|
|
17
|
+
this.bloc = bloc;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Subscribe to state changes
|
|
21
|
+
*/
|
|
22
|
+
subscribe(options) {
|
|
23
|
+
const id = `${options.type}-${(0, uuid_1.generateUUID)()}`;
|
|
24
|
+
const subscription = {
|
|
25
|
+
id,
|
|
26
|
+
type: options.type,
|
|
27
|
+
selector: options.selector,
|
|
28
|
+
equalityFn: options.equalityFn || Object.is,
|
|
29
|
+
notify: options.notify,
|
|
30
|
+
priority: options.priority ?? 0,
|
|
31
|
+
weakRef: options.weakRef,
|
|
32
|
+
dependencies: new Set(),
|
|
33
|
+
metadata: {
|
|
34
|
+
lastNotified: Date.now(),
|
|
35
|
+
hasRendered: false,
|
|
36
|
+
accessCount: 0,
|
|
37
|
+
firstAccessTime: Date.now(),
|
|
38
|
+
},
|
|
39
|
+
};
|
|
40
|
+
// Initialize selector value if provided
|
|
41
|
+
if (subscription.selector) {
|
|
42
|
+
try {
|
|
43
|
+
subscription.lastValue = subscription.selector(this.bloc.state, this.bloc);
|
|
44
|
+
}
|
|
45
|
+
catch (error) {
|
|
46
|
+
Blac_1.Blac.error(`SubscriptionManager: Error in selector for ${id}:`, error);
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
this.subscriptions.set(id, subscription);
|
|
50
|
+
Blac_1.Blac.log(`[${this.bloc._name}:${this.bloc._id}] Subscription added: ${id}. Total: ${this.subscriptions.size}`);
|
|
51
|
+
// Cancel disposal if bloc is in disposal_requested state
|
|
52
|
+
this.bloc._cancelDisposalIfRequested();
|
|
53
|
+
// Return unsubscribe function
|
|
54
|
+
return () => this.unsubscribe(id);
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* Unsubscribe by ID
|
|
58
|
+
*/
|
|
59
|
+
unsubscribe(id) {
|
|
60
|
+
const subscription = this.subscriptions.get(id);
|
|
61
|
+
if (!subscription)
|
|
62
|
+
return;
|
|
63
|
+
// Remove from path dependencies
|
|
64
|
+
if (subscription.dependencies) {
|
|
65
|
+
for (const path of subscription.dependencies) {
|
|
66
|
+
const subs = this.pathToSubscriptions.get(path);
|
|
67
|
+
if (subs) {
|
|
68
|
+
subs.delete(id);
|
|
69
|
+
if (subs.size === 0) {
|
|
70
|
+
this.pathToSubscriptions.delete(path);
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
this.subscriptions.delete(id);
|
|
76
|
+
Blac_1.Blac.log(`[${this.bloc._name}:${this.bloc._id}] Subscription removed: ${id}. Remaining: ${this.subscriptions.size}`);
|
|
77
|
+
// Check if bloc should be disposed
|
|
78
|
+
this.bloc.checkDisposal();
|
|
79
|
+
}
|
|
80
|
+
/**
|
|
81
|
+
* Notify all subscriptions of state change
|
|
82
|
+
*/
|
|
83
|
+
notify(newState, oldState, action) {
|
|
84
|
+
// Clean up dead weak references if needed
|
|
85
|
+
this.cleanupDeadReferences();
|
|
86
|
+
// Sort subscriptions by priority (descending)
|
|
87
|
+
const sortedSubscriptions = Array.from(this.subscriptions.values()).sort((a, b) => (b.priority ?? 0) - (a.priority ?? 0));
|
|
88
|
+
for (const subscription of sortedSubscriptions) {
|
|
89
|
+
// Check if WeakRef is still alive
|
|
90
|
+
if (subscription.weakRef && !subscription.weakRef.deref()) {
|
|
91
|
+
this.scheduleWeakRefCleanup();
|
|
92
|
+
continue;
|
|
93
|
+
}
|
|
94
|
+
let shouldNotify = false;
|
|
95
|
+
let newValue;
|
|
96
|
+
let oldValue;
|
|
97
|
+
if (subscription.selector) {
|
|
98
|
+
// Use selector to determine if notification is needed
|
|
99
|
+
try {
|
|
100
|
+
newValue = subscription.selector(newState, this.bloc);
|
|
101
|
+
oldValue = subscription.lastValue;
|
|
102
|
+
const equalityFn = subscription.equalityFn || Object.is;
|
|
103
|
+
shouldNotify = !equalityFn(oldValue, newValue);
|
|
104
|
+
if (shouldNotify) {
|
|
105
|
+
subscription.lastValue = newValue;
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
catch (error) {
|
|
109
|
+
Blac_1.Blac.error(`SubscriptionManager: Error in selector for ${subscription.id}:`, error);
|
|
110
|
+
continue;
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
else {
|
|
114
|
+
// No selector - check if tracked dependencies changed
|
|
115
|
+
if (subscription.dependencies && subscription.dependencies.size > 0) {
|
|
116
|
+
// Check which paths changed between old and new state
|
|
117
|
+
const changedPaths = this.getChangedPaths(oldState, newState);
|
|
118
|
+
shouldNotify = this.shouldNotifyForPaths(subscription.id, changedPaths);
|
|
119
|
+
if (Blac_1.Blac.config.logLevel === 'debug') {
|
|
120
|
+
Blac_1.Blac.log(`[SubscriptionManager] Subscription ${subscription.id} dependencies:`, Array.from(subscription.dependencies));
|
|
121
|
+
Blac_1.Blac.log(`[SubscriptionManager] Changed paths:`, Array.from(changedPaths));
|
|
122
|
+
Blac_1.Blac.log(`[SubscriptionManager] Should notify:`, shouldNotify);
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
else {
|
|
126
|
+
// No tracked dependencies, always notify
|
|
127
|
+
shouldNotify = true;
|
|
128
|
+
}
|
|
129
|
+
newValue = newState;
|
|
130
|
+
oldValue = oldState;
|
|
131
|
+
}
|
|
132
|
+
if (shouldNotify) {
|
|
133
|
+
try {
|
|
134
|
+
subscription.notify(newValue, oldValue, action);
|
|
135
|
+
this.totalNotifications++;
|
|
136
|
+
if (subscription.metadata) {
|
|
137
|
+
subscription.metadata.lastNotified = Date.now();
|
|
138
|
+
subscription.metadata.hasRendered = true;
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
catch (error) {
|
|
142
|
+
Blac_1.Blac.error(`SubscriptionManager: Error in notify for ${subscription.id}:`, error);
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
/**
|
|
148
|
+
* Track a path access for a subscription
|
|
149
|
+
*/
|
|
150
|
+
trackAccess(subscriptionId, path, _value) {
|
|
151
|
+
const subscription = this.subscriptions.get(subscriptionId);
|
|
152
|
+
if (!subscription)
|
|
153
|
+
return;
|
|
154
|
+
// Update dependencies
|
|
155
|
+
if (!subscription.dependencies) {
|
|
156
|
+
subscription.dependencies = new Set();
|
|
157
|
+
}
|
|
158
|
+
subscription.dependencies.add(path);
|
|
159
|
+
// Update path-to-subscription mapping
|
|
160
|
+
let subs = this.pathToSubscriptions.get(path);
|
|
161
|
+
if (!subs) {
|
|
162
|
+
subs = new Set();
|
|
163
|
+
this.pathToSubscriptions.set(path, subs);
|
|
164
|
+
}
|
|
165
|
+
subs.add(subscriptionId);
|
|
166
|
+
// Update metadata
|
|
167
|
+
if (subscription.metadata) {
|
|
168
|
+
subscription.metadata.accessCount =
|
|
169
|
+
(subscription.metadata.accessCount || 0) + 1;
|
|
170
|
+
subscription.metadata.lastAccessTime = Date.now();
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
/**
|
|
174
|
+
* Get the paths that changed between two states
|
|
175
|
+
*/
|
|
176
|
+
getChangedPaths(oldState, newState, path = '') {
|
|
177
|
+
const changedPaths = new Set();
|
|
178
|
+
if (oldState === newState)
|
|
179
|
+
return changedPaths;
|
|
180
|
+
// Handle primitives
|
|
181
|
+
if (typeof oldState !== 'object' ||
|
|
182
|
+
typeof newState !== 'object' ||
|
|
183
|
+
oldState === null ||
|
|
184
|
+
newState === null) {
|
|
185
|
+
if (path)
|
|
186
|
+
changedPaths.add(path);
|
|
187
|
+
return changedPaths;
|
|
188
|
+
}
|
|
189
|
+
// Get all keys from both objects
|
|
190
|
+
const allKeys = new Set([
|
|
191
|
+
...Object.keys(oldState),
|
|
192
|
+
...Object.keys(newState),
|
|
193
|
+
]);
|
|
194
|
+
for (const key of allKeys) {
|
|
195
|
+
const fullPath = path ? `${path}.${key}` : key;
|
|
196
|
+
const oldValue = oldState[key];
|
|
197
|
+
const newValue = newState[key];
|
|
198
|
+
if (oldValue !== newValue) {
|
|
199
|
+
changedPaths.add(fullPath);
|
|
200
|
+
// For nested objects, get all nested changed paths
|
|
201
|
+
if (typeof oldValue === 'object' &&
|
|
202
|
+
typeof newValue === 'object' &&
|
|
203
|
+
oldValue !== null &&
|
|
204
|
+
newValue !== null) {
|
|
205
|
+
const nestedChanges = this.getChangedPaths(oldValue, newValue, fullPath);
|
|
206
|
+
nestedChanges.forEach((p) => changedPaths.add(p));
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
return changedPaths;
|
|
211
|
+
}
|
|
212
|
+
/**
|
|
213
|
+
* Check if a subscription should be notified based on changed paths
|
|
214
|
+
*/
|
|
215
|
+
shouldNotifyForPaths(subscriptionId, changedPaths) {
|
|
216
|
+
const subscription = this.subscriptions.get(subscriptionId);
|
|
217
|
+
if (!subscription || !subscription.dependencies)
|
|
218
|
+
return true;
|
|
219
|
+
// Check if any tracked dependencies match changed paths
|
|
220
|
+
for (const trackedPath of subscription.dependencies) {
|
|
221
|
+
// Handle class getter dependencies (_class.propertyName)
|
|
222
|
+
if (trackedPath.startsWith('_class.')) {
|
|
223
|
+
// For class getters, we need to notify on any state change
|
|
224
|
+
// since we can't determine which state properties the getter depends on
|
|
225
|
+
// This is conservative but ensures correctness
|
|
226
|
+
if (changedPaths.size > 0) {
|
|
227
|
+
return true;
|
|
228
|
+
}
|
|
229
|
+
continue;
|
|
230
|
+
}
|
|
231
|
+
// Check direct path matches
|
|
232
|
+
if (changedPaths.has(trackedPath))
|
|
233
|
+
return true;
|
|
234
|
+
// Check nested paths
|
|
235
|
+
for (const changedPath of changedPaths) {
|
|
236
|
+
if (changedPath.startsWith(trackedPath + '.') ||
|
|
237
|
+
trackedPath.startsWith(changedPath + '.')) {
|
|
238
|
+
return true;
|
|
239
|
+
}
|
|
240
|
+
}
|
|
241
|
+
}
|
|
242
|
+
return false;
|
|
243
|
+
}
|
|
244
|
+
/**
|
|
245
|
+
* Get statistics about subscriptions
|
|
246
|
+
*/
|
|
247
|
+
getStats() {
|
|
248
|
+
let consumerCount = 0;
|
|
249
|
+
let observerCount = 0;
|
|
250
|
+
for (const sub of this.subscriptions.values()) {
|
|
251
|
+
if (sub.type === 'consumer')
|
|
252
|
+
consumerCount++;
|
|
253
|
+
else
|
|
254
|
+
observerCount++;
|
|
255
|
+
}
|
|
256
|
+
return {
|
|
257
|
+
activeSubscriptions: this.subscriptions.size,
|
|
258
|
+
consumerCount,
|
|
259
|
+
observerCount,
|
|
260
|
+
totalNotifications: this.totalNotifications,
|
|
261
|
+
trackedDependencies: this.pathToSubscriptions.size,
|
|
262
|
+
};
|
|
263
|
+
}
|
|
264
|
+
/**
|
|
265
|
+
* Clear all subscriptions
|
|
266
|
+
*/
|
|
267
|
+
clear() {
|
|
268
|
+
this.subscriptions.clear();
|
|
269
|
+
this.pathToSubscriptions.clear();
|
|
270
|
+
}
|
|
271
|
+
/**
|
|
272
|
+
* Get subscription by ID
|
|
273
|
+
*/
|
|
274
|
+
getSubscription(id) {
|
|
275
|
+
return this.subscriptions.get(id);
|
|
276
|
+
}
|
|
277
|
+
/**
|
|
278
|
+
* Check if there are any active subscriptions
|
|
279
|
+
*/
|
|
280
|
+
get hasSubscriptions() {
|
|
281
|
+
return this.subscriptions.size > 0;
|
|
282
|
+
}
|
|
283
|
+
/**
|
|
284
|
+
* Get count of active subscriptions
|
|
285
|
+
*/
|
|
286
|
+
get size() {
|
|
287
|
+
return this.subscriptions.size;
|
|
288
|
+
}
|
|
289
|
+
/**
|
|
290
|
+
* Clean up subscriptions with dead weak references
|
|
291
|
+
*/
|
|
292
|
+
cleanupDeadReferences() {
|
|
293
|
+
if (!this.weakRefCleanupScheduled)
|
|
294
|
+
return;
|
|
295
|
+
const deadIds = [];
|
|
296
|
+
for (const [id, subscription] of this.subscriptions) {
|
|
297
|
+
if (subscription.weakRef && !subscription.weakRef.deref()) {
|
|
298
|
+
deadIds.push(id);
|
|
299
|
+
}
|
|
300
|
+
}
|
|
301
|
+
for (const id of deadIds) {
|
|
302
|
+
this.unsubscribe(id);
|
|
303
|
+
}
|
|
304
|
+
this.weakRefCleanupScheduled = false;
|
|
305
|
+
}
|
|
306
|
+
/**
|
|
307
|
+
* Schedule weak reference cleanup for next tick
|
|
308
|
+
*/
|
|
309
|
+
scheduleWeakRefCleanup() {
|
|
310
|
+
if (this.weakRefCleanupScheduled)
|
|
311
|
+
return;
|
|
312
|
+
this.weakRefCleanupScheduled = true;
|
|
313
|
+
queueMicrotask(() => this.cleanupDeadReferences());
|
|
314
|
+
}
|
|
315
|
+
}
|
|
316
|
+
exports.SubscriptionManager = SubscriptionManager;
|
|
317
|
+
//# sourceMappingURL=SubscriptionManager.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SubscriptionManager.js","sourceRoot":"","sources":["../../src/subscription/SubscriptionManager.ts"],"names":[],"mappings":";;;AACA,kCAA+B;AAC/B,wCAA6C;AAO7C;;;GAGG;AACH,MAAa,mBAAmB;IAMV;IALZ,aAAa,GAAG,IAAI,GAAG,EAA2B,CAAC;IACnD,mBAAmB,GAAG,IAAI,GAAG,EAAuB,CAAC;IACrD,uBAAuB,GAAG,KAAK,CAAC;IAChC,kBAAkB,GAAG,CAAC,CAAC;IAE/B,YAAoB,IAAiB;QAAjB,SAAI,GAAJ,IAAI,CAAa;IAAG,CAAC;IAEzC;;OAEG;IACH,SAAS,CAAC,OAA+B;QACvC,MAAM,EAAE,GAAG,GAAG,OAAO,CAAC,IAAI,IAAI,IAAA,mBAAY,GAAE,EAAE,CAAC;QAE/C,MAAM,YAAY,GAAoB;YACpC,EAAE;YACF,IAAI,EAAE,OAAO,CAAC,IAAI;YAClB,QAAQ,EAAE,OAAO,CAAC,QAAQ;YAC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,CAAC,aAAa,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;IACpC,CAAC;IAED;;OAEG;IACH,IAAI,gBAAgB;QAClB,OAAO,IAAI,CAAC,aAAa,CAAC,IAAI,GAAG,CAAC,CAAC;IACrC,CAAC;IAED;;OAEG;IACH,IAAI,IAAI;QACN,OAAO,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC;IACjC,CAAC;IAED;;OAEG;IACK,qBAAqB;QAC3B,IAAI,CAAC,IAAI,CAAC,uBAAuB;YAAE,OAAO;QAE1C,MAAM,OAAO,GAAa,EAAE,CAAC;QAE7B,KAAK,MAAM,CAAC,EAAE,EAAE,YAAY,CAAC,IAAI,IAAI,CAAC,aAAa,EAAE,CAAC;YACpD,IAAI,YAAY,CAAC,OAAO,IAAI,CAAC,YAAY,CAAC,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC;gBAC1D,OAAO,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;YACnB,CAAC;QACH,CAAC;QAED,KAAK,MAAM,EAAE,IAAI,OAAO,EAAE,CAAC;YACzB,IAAI,CAAC,WAAW,CAAC,EAAE,CAAC,CAAC;QACvB,CAAC;QAED,IAAI,CAAC,uBAAuB,GAAG,KAAK,CAAC;IACvC,CAAC;IAED;;OAEG;IACK,sBAAsB;QAC5B,IAAI,IAAI,CAAC,uBAAuB;YAAE,OAAO;QAEzC,IAAI,CAAC,uBAAuB,GAAG,IAAI,CAAC;QACpC,cAAc,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,qBAAqB,EAAE,CAAC,CAAC;IACrD,CAAC;CACF;AA7XD,kDA6XC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/subscription/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC;AACxB,cAAc,uBAAuB,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./types"), exports);
|
|
18
|
+
__exportStar(require("./SubscriptionManager"), exports);
|
|
19
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/subscription/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,0CAAwB;AACxB,wDAAsC"}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { BlocBase } from '../BlocBase';
|
|
2
|
+
/**
|
|
3
|
+
* Unified subscription interface that replaces the dual consumer/observer system
|
|
4
|
+
*/
|
|
5
|
+
export interface Subscription<S = unknown> {
|
|
6
|
+
/** Unique identifier for the subscription */
|
|
7
|
+
id: string;
|
|
8
|
+
/** Type of subscription for backward compatibility */
|
|
9
|
+
type: 'consumer' | 'observer';
|
|
10
|
+
/** Optional selector function to derive values from state */
|
|
11
|
+
selector?: (state: S, bloc?: BlocBase<S>) => unknown;
|
|
12
|
+
/** Custom equality function for selector results (defaults to Object.is) */
|
|
13
|
+
equalityFn?: (prev: unknown, next: unknown) => boolean;
|
|
14
|
+
/** Notification callback when state changes */
|
|
15
|
+
notify: (value: unknown, oldValue?: unknown, action?: unknown) => void;
|
|
16
|
+
/** Priority for notification order (higher = earlier) */
|
|
17
|
+
priority?: number;
|
|
18
|
+
/** WeakRef to the subscriber for automatic cleanup (React components) */
|
|
19
|
+
weakRef?: WeakRef<object>;
|
|
20
|
+
/** Last computed selector value for comparison */
|
|
21
|
+
lastValue?: unknown;
|
|
22
|
+
/** Tracked state path dependencies */
|
|
23
|
+
dependencies?: Set<string>;
|
|
24
|
+
/** Metadata for tracking and debugging */
|
|
25
|
+
metadata?: SubscriptionMetadata;
|
|
26
|
+
}
|
|
27
|
+
export interface SubscriptionMetadata {
|
|
28
|
+
/** Timestamp of last notification */
|
|
29
|
+
lastNotified?: number;
|
|
30
|
+
/** Whether the subscriber has rendered (React-specific) */
|
|
31
|
+
hasRendered?: boolean;
|
|
32
|
+
/** Number of times this subscription accessed state */
|
|
33
|
+
accessCount?: number;
|
|
34
|
+
/** First access timestamp */
|
|
35
|
+
firstAccessTime?: number;
|
|
36
|
+
/** Last access timestamp */
|
|
37
|
+
lastAccessTime?: number;
|
|
38
|
+
}
|
|
39
|
+
export interface SubscriptionOptions<S> {
|
|
40
|
+
/** Type of subscription */
|
|
41
|
+
type: 'consumer' | 'observer';
|
|
42
|
+
/** Optional selector function */
|
|
43
|
+
selector?: (state: S, bloc?: BlocBase<S>) => unknown;
|
|
44
|
+
/** Custom equality function */
|
|
45
|
+
equalityFn?: (prev: unknown, next: unknown) => boolean;
|
|
46
|
+
/** Notification callback */
|
|
47
|
+
notify: (value: unknown, oldValue?: unknown, action?: unknown) => void;
|
|
48
|
+
/** Priority for notifications */
|
|
49
|
+
priority?: number;
|
|
50
|
+
/** WeakRef to subscriber */
|
|
51
|
+
weakRef?: WeakRef<object>;
|
|
52
|
+
}
|
|
53
|
+
export interface SubscriptionManagerStats {
|
|
54
|
+
/** Total number of active subscriptions */
|
|
55
|
+
activeSubscriptions: number;
|
|
56
|
+
/** Number of consumer subscriptions */
|
|
57
|
+
consumerCount: number;
|
|
58
|
+
/** Number of observer subscriptions */
|
|
59
|
+
observerCount: number;
|
|
60
|
+
/** Total notifications sent */
|
|
61
|
+
totalNotifications: number;
|
|
62
|
+
/** Number of tracked dependencies */
|
|
63
|
+
trackedDependencies: number;
|
|
64
|
+
}
|
|
65
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/subscription/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAEvC;;GAEG;AACH,MAAM,WAAW,YAAY,CAAC,CAAC,GAAG,OAAO;IACvC,6CAA6C;IAC7C,EAAE,EAAE,MAAM,CAAC;IAEX,sDAAsD;IACtD,IAAI,EAAE,UAAU,GAAG,UAAU,CAAC;IAE9B,6DAA6D;IAC7D,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,CAAC,EAAE,IAAI,CAAC,EAAE,QAAQ,CAAC,CAAC,CAAC,KAAK,OAAO,CAAC;IAErD,4EAA4E;IAC5E,UAAU,CAAC,EAAE,CAAC,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,OAAO,KAAK,OAAO,CAAC;IAEvD,+CAA+C;IAC/C,MAAM,EAAE,CAAC,KAAK,EAAE,OAAO,EAAE,QAAQ,CAAC,EAAE,OAAO,EAAE,MAAM,CAAC,EAAE,OAAO,KAAK,IAAI,CAAC;IAEvE,yDAAyD;IACzD,QAAQ,CAAC,EAAE,MAAM,CAAC;IAElB,yEAAyE;IACzE,OAAO,CAAC,EAAE,OAAO,CAAC,MAAM,CAAC,CAAC;IAE1B,kDAAkD;IAClD,SAAS,CAAC,EAAE,OAAO,CAAC;IAEpB,sCAAsC;IACtC,YAAY,CAAC,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;IAE3B,0CAA0C;IAC1C,QAAQ,CAAC,EAAE,oBAAo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sourceRoot":"","sources":["../../src/subscription/types.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { Bloc } from './Bloc';
|
|
2
|
+
import { BlocBase } from './BlocBase';
|
|
3
|
+
import { BlocEventConstraint } from './types';
|
|
4
|
+
/**
|
|
5
|
+
* Test utilities for Blac state management
|
|
6
|
+
*
|
|
7
|
+
* @deprecated Use Blac methods directly instead:
|
|
8
|
+
* - Blac.resetInstance() for test setup
|
|
9
|
+
* - Blac.getBloc() to create/get bloc instances
|
|
10
|
+
* - bloc.subscribe() for state monitoring
|
|
11
|
+
*
|
|
12
|
+
* Example:
|
|
13
|
+
* ```typescript
|
|
14
|
+
* beforeEach(() => {
|
|
15
|
+
* Blac.resetInstance();
|
|
16
|
+
* Blac.enableLog = false;
|
|
17
|
+
* });
|
|
18
|
+
*
|
|
19
|
+
* it('should test bloc', () => {
|
|
20
|
+
* const bloc = Blac.getBloc(MyBloc);
|
|
21
|
+
* // test logic
|
|
22
|
+
* });
|
|
23
|
+
* ```
|
|
24
|
+
*/
|
|
25
|
+
/**
|
|
26
|
+
* Waits for a bloc to emit a specific state
|
|
27
|
+
*/
|
|
28
|
+
export declare function waitForState<T extends BlocBase<S>, S>(bloc: T, predicate: (state: S) => boolean, timeout?: number): Promise<S>;
|
|
29
|
+
/**
|
|
30
|
+
* Waits for a bloc to emit a specific event
|
|
31
|
+
*/
|
|
32
|
+
export declare function waitForEvent<T extends Bloc<any, E>, E extends BlocEventConstraint>(bloc: T, eventType: new (...args: any[]) => E, timeout?: number): Promise<E>;
|
|
33
|
+
//# sourceMappingURL=testing.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"testing.d.ts","sourceRoot":"","sources":["../src/testing.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAC9B,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAEtC,OAAO,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAC;AAE9C;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH;;GAEG;AACH,wBAAsB,YAAY,CAAC,CAAC,SAAS,QAAQ,CAAC,CAAC,CAAC,EAAE,CAAC,EACzD,IAAI,EAAE,CAAC,EACP,SAAS,EAAE,CAAC,KAAK,EAAE,CAAC,KAAK,OAAO,EAChC,OAAO,SAAO,GACb,OAAO,CAAC,CAAC,CAAC,CAyBZ;AAED;;GAEG;AACH,wBAAsB,YAAY,CAChC,CAAC,SAAS,IAAI,CAAC,GAAG,EAAE,CAAC,CAAC,EACtB,CAAC,SAAS,mBAAmB,EAC7B,IAAI,EAAE,CAAC,EAAE,SAAS,EAAE,KAAK,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,CAAC,EAAE,OAAO,SAAO,GAAG,OAAO,CAAC,CAAC,CAAC,CAoB3E"}
|
package/dist/testing.js
ADDED
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.waitForState = waitForState;
|
|
4
|
+
exports.waitForEvent = waitForEvent;
|
|
5
|
+
/**
|
|
6
|
+
* Test utilities for Blac state management
|
|
7
|
+
*
|
|
8
|
+
* @deprecated Use Blac methods directly instead:
|
|
9
|
+
* - Blac.resetInstance() for test setup
|
|
10
|
+
* - Blac.getBloc() to create/get bloc instances
|
|
11
|
+
* - bloc.subscribe() for state monitoring
|
|
12
|
+
*
|
|
13
|
+
* Example:
|
|
14
|
+
* ```typescript
|
|
15
|
+
* beforeEach(() => {
|
|
16
|
+
* Blac.resetInstance();
|
|
17
|
+
* Blac.enableLog = false;
|
|
18
|
+
* });
|
|
19
|
+
*
|
|
20
|
+
* it('should test bloc', () => {
|
|
21
|
+
* const bloc = Blac.getBloc(MyBloc);
|
|
22
|
+
* // test logic
|
|
23
|
+
* });
|
|
24
|
+
* ```
|
|
25
|
+
*/
|
|
26
|
+
/**
|
|
27
|
+
* Waits for a bloc to emit a specific state
|
|
28
|
+
*/
|
|
29
|
+
async function waitForState(bloc, predicate, timeout = 5000) {
|
|
30
|
+
return new Promise((resolve, reject) => {
|
|
31
|
+
const timeoutId = setTimeout(() => {
|
|
32
|
+
reject(new Error(`Timeout waiting for state matching predicate after ${timeout}ms`));
|
|
33
|
+
}, timeout);
|
|
34
|
+
const unsubscribe = bloc.subscribe((newState) => {
|
|
35
|
+
if (predicate(newState)) {
|
|
36
|
+
clearTimeout(timeoutId);
|
|
37
|
+
unsubscribe();
|
|
38
|
+
resolve(newState);
|
|
39
|
+
}
|
|
40
|
+
});
|
|
41
|
+
// Check current state immediately
|
|
42
|
+
if (predicate(bloc.state)) {
|
|
43
|
+
clearTimeout(timeoutId);
|
|
44
|
+
unsubscribe();
|
|
45
|
+
resolve(bloc.state);
|
|
46
|
+
}
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Waits for a bloc to emit a specific event
|
|
51
|
+
*/
|
|
52
|
+
async function waitForEvent(bloc, eventType, timeout = 5000) {
|
|
53
|
+
return new Promise((resolve, reject) => {
|
|
54
|
+
const timeoutId = setTimeout(() => {
|
|
55
|
+
reject(new Error(`Timeout waiting for event ${eventType.name} after ${timeout}ms`));
|
|
56
|
+
}, timeout);
|
|
57
|
+
const originalAdd = bloc.add.bind(bloc);
|
|
58
|
+
bloc.add = (event) => {
|
|
59
|
+
if (event instanceof eventType) {
|
|
60
|
+
clearTimeout(timeoutId);
|
|
61
|
+
bloc.add = originalAdd;
|
|
62
|
+
resolve(event);
|
|
63
|
+
}
|
|
64
|
+
return originalAdd(event);
|
|
65
|
+
};
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
//# sourceMappingURL=testing.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"testing.js","sourceRoot":"","sources":["../src/testing.ts"],"names":[],"mappings":";;AA+BA,oCA6BC;AAKD,oCAuBC;AAlFD;;;;;;;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C,IAAI,CAAC,GAAG,GAAG,CAAC,KAAQ,EAAE,EAAE;YACtB,IAAI,KAAK,YAAY,SAAS,EAAE,CAAC;gBAC/B,YAAY,CAAC,SAAS,CAAC,CAAC;gBACxB,IAAI,CAAC,GAAG,GAAG,WAAW,CAAC;gBACvB,OAAO,CAAC,KAAK,CAAC,CAAC;YACjB,CAAC;YACD,OAAO,WAAW,CAAC,KAAK,CAAC,CAAC;QAC5B,CAAC,CAAC;IACJ,CAAC,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -1,62 +1,48 @@
|
|
|
1
|
-
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
2
1
|
import { Bloc } from './Bloc';
|
|
3
2
|
import { BlocBase } from './BlocBase';
|
|
4
3
|
import { Cubit } from './Cubit';
|
|
5
|
-
|
|
6
4
|
/**
|
|
7
5
|
* Represents a constructor type for a Bloc that takes no parameters
|
|
8
6
|
* @template B - The type of the Bloc instance
|
|
9
7
|
*/
|
|
10
8
|
export type BlocClassNoParams<B> = new (args: never[]) => B;
|
|
11
|
-
|
|
12
9
|
/**
|
|
13
10
|
* Represents the abstract base types for Bloc and Cubit
|
|
14
11
|
*/
|
|
15
12
|
export type BlocBaseAbstract = typeof Bloc<any, any> | typeof Cubit<any>;
|
|
16
|
-
|
|
17
13
|
/**
|
|
18
14
|
* Represents a constructor type for a Bloc that can take any parameters
|
|
19
15
|
* @template B - The type of the Bloc instance
|
|
20
16
|
*/
|
|
21
17
|
export type BlocConstructor<B> = (new (...args: any) => B) & {
|
|
22
|
-
|
|
23
|
-
|
|
18
|
+
isolated?: boolean;
|
|
19
|
+
keepAlive?: boolean;
|
|
24
20
|
};
|
|
25
|
-
|
|
26
|
-
export type BlocConstructorParams<B extends BlocConstructor<BlocBase<any>>> =
|
|
27
|
-
ConstructorParameters<B>[0];
|
|
28
|
-
|
|
21
|
+
export type BlocConstructorParams<B extends BlocConstructor<BlocBase<any>>> = ConstructorParameters<B>[0];
|
|
29
22
|
/**
|
|
30
23
|
* Extracts the state type from a BlocBase instance
|
|
31
24
|
* @template B - The BlocBase type to extract the state from
|
|
32
25
|
*/
|
|
33
|
-
export type ValueType<B extends BlocBase<any>> =
|
|
34
|
-
B extends BlocBase<infer U> ? U : never;
|
|
35
|
-
|
|
26
|
+
export type ValueType<B extends BlocBase<any>> = B extends BlocBase<infer U> ? U : never;
|
|
36
27
|
/**
|
|
37
28
|
* Extracts the state type from either a Bloc or Cubit
|
|
38
29
|
* @template T - The Bloc or Cubit type to extract the state from
|
|
39
30
|
*/
|
|
40
31
|
export type BlocState<T> = T extends BlocBase<infer S> ? S : never;
|
|
41
|
-
|
|
42
32
|
/**
|
|
43
33
|
* Enhanced constraint for Bloc events - must be objects with proper constructor
|
|
44
34
|
*/
|
|
45
35
|
export type BlocEventConstraint = object;
|
|
46
|
-
|
|
47
36
|
/**
|
|
48
37
|
* Error boundary interface for Bloc error handling
|
|
49
38
|
*/
|
|
50
39
|
export interface BlocErrorBoundary<S, A extends BlocEventConstraint> {
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
) => void | Promise<void>;
|
|
57
|
-
shouldRethrow?: (error: Error, event: A) => boolean;
|
|
40
|
+
onError: (error: Error, event: A, currentState: S, bloc: {
|
|
41
|
+
name: string;
|
|
42
|
+
id: string;
|
|
43
|
+
}) => void | Promise<void>;
|
|
44
|
+
shouldRethrow?: (error: Error, event: A) => boolean;
|
|
58
45
|
}
|
|
59
|
-
|
|
60
46
|
/**
|
|
61
47
|
* Function type for determining dependencies that trigger re-renders
|
|
62
48
|
* Similar to React's useEffect dependency array - if any dependency changes, a re-render is triggered
|
|
@@ -67,8 +53,5 @@ export interface BlocErrorBoundary<S, A extends BlocEventConstraint> {
|
|
|
67
53
|
* @param instance The bloc instance
|
|
68
54
|
* @returns Array of dependencies - if any dependency changes, a re-render is triggered
|
|
69
55
|
*/
|
|
70
|
-
export type BlocHookDependencyArrayFn<S, I = any> = (
|
|
71
|
-
|
|
72
|
-
previousState: S | undefined,
|
|
73
|
-
instance: I,
|
|
74
|
-
) => unknown[];
|
|
56
|
+
export type BlocHookDependencyArrayFn<S, I = any> = (currentState: S, previousState: S | undefined, instance: I) => unknown[];
|
|
57
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAC9B,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAEhC;;;GAGG;AACH,MAAM,MAAM,iBAAiB,CAAC,CAAC,IAAI,KAAK,IAAI,EAAE,KAAK,EAAE,KAAK,CAAC,CAAC;AAE5D;;GAEG;AACH,MAAM,MAAM,gBAAgB,GAAG,OAAO,IAAI,CAAC,GAAG,EAAE,GAAG,CAAC,GAAG,OAAO,KAAK,CAAC,GAAG,CAAC,CAAC;AAEzE;;;GAGG;AACH,MAAM,MAAM,eAAe,CAAC,CAAC,IAAI,CAAC,KAAK,GAAG,IAAI,EAAE,GAAG,KAAK,CAAC,CAAC,GAAG;IAC3D,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB,CAAC;AAEF,MAAM,MAAM,qBAAqB,CAAC,CAAC,SAAS,eAAe,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,IACxE,qBAAqB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AAE9B;;;GAGG;AACH,MAAM,MAAM,SAAS,CAAC,CAAC,SAAS,QAAQ,CAAC,GAAG,CAAC,IAC3C,CAAC,SAAS,QAAQ,CAAC,MAAM,CAAC,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC;AAE1C;;;GAGG;AACH,MAAM,MAAM,SAAS,CAAC,CAAC,IAAI,CA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