@alwatr/signal 5.2.1 → 6.0.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/CHANGELOG.md CHANGED
@@ -3,6 +3,47 @@
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
+ ## [6.0.0](https://github.com/Alwatr/flux/compare/v5.2.2...v6.0.0) (2025-09-19)
7
+
8
+ ### ✨ Features
9
+
10
+ * add asReadonly method to StateSignal for improved interface exposure ([e8be13a](https://github.com/Alwatr/flux/commit/e8be13aa1b49c0e67b8022b0bef02fb80e5499f4))
11
+
12
+ ### 🐛 Bug Fixes
13
+
14
+ * remove space in logger initialization for signal classes ([6e3b071](https://github.com/Alwatr/flux/commit/6e3b0710b67f67849c4dce390e9bfa7b2f80a9f7))
15
+
16
+ ### 🔨 Code Refactoring
17
+
18
+ * enhance logging during EffectSignal construction for dependency subscriptions ([062da7e](https://github.com/Alwatr/flux/commit/062da7e5a91070576579731ac21870ffcafa7033))
19
+ * enhance logging in update method to track value changes ([5b0bb00](https://github.com/Alwatr/flux/commit/5b0bb000a7aeb37ab90405f34959b230ca575232))
20
+ * replace signalId with name in signal implementation ([0c2f065](https://github.com/Alwatr/flux/commit/0c2f065bb0afa49980537e42773cbbf21013a2a3))
21
+ * update internal signal name format and enhance logging during dependency subscription ([1670726](https://github.com/Alwatr/flux/commit/1670726059b77b058b9daa3841bb7bb1ded61af3))
22
+
23
+ ### 🔗 Dependencies update
24
+
25
+ * update @alwatr/logger to version 6.0.2 and @types/node to version 22.18.6; upgrade esbuild and other dependencies ([95dfaba](https://github.com/Alwatr/flux/commit/95dfabab2a4d4ea2b0e42a70bee1f3e68a67bffc))
26
+ * update dependencies for logger, nano-build, type-helper, and node types ([23fe723](https://github.com/Alwatr/flux/commit/23fe7236ffa0bfd2551a6dfc52c23689ce4b036e))
27
+ * update package dependencies for improved compatibility and performance ([1e91063](https://github.com/Alwatr/flux/commit/1e9106343d01330089c33d9591969a66625a1e7b))
28
+
29
+ ## [5.2.2](https://github.com/Alwatr/flux/compare/v5.2.1...v5.2.2) (2025-09-15)
30
+
31
+ ### 🐛 Bug Fixes
32
+
33
+ * update subscription to prevent receiving previous value in debounced signal ([044780d](https://github.com/Alwatr/flux/commit/044780d35427a97711788224e60e209fb53dea53))
34
+ * update subscription to trigger debouncer with value from source signal ([a7e8eff](https://github.com/Alwatr/flux/commit/a7e8effd7e963aaf905afae08a652d7abe222c3a))
35
+
36
+ ### 🔨 Code Refactoring
37
+
38
+ * improve logging in subscribe method to pass options directly ([e026dbf](https://github.com/Alwatr/flux/commit/e026dbf74ca96ec6d878bd5fb08f4939c46d08f2))
39
+ * simplify signalId assignment using nullish coalescing operator ([0578c85](https://github.com/Alwatr/flux/commit/0578c854677df2fe0a62e5fbbfa017856d82b611))
40
+ * update logging in subscribe method to pass options directly ([a7e32f2](https://github.com/Alwatr/flux/commit/a7e32f20df6b12c1c9dd06feaf01fca8170a5346))
41
+
42
+ ### 🧹 Miscellaneous Chores
43
+
44
+ * update @alwatr/debounce dependency to version 1.1.1 ([c2e2ae4](https://github.com/Alwatr/flux/commit/c2e2ae4fe54f8fdd482bd53b598f5e88570a26f2))
45
+ * update package dependencies to latest versions ([a517c82](https://github.com/Alwatr/flux/commit/a517c82b99073a65a8470da428dfd288080b7ea5))
46
+
6
47
  ## [5.2.1](https://github.com/Alwatr/flux/compare/v5.2.0...v5.2.1) (2025-09-15)
7
48
 
8
49
  ### ⚡ Performance Improvements
package/README.md CHANGED
@@ -4,6 +4,12 @@ Alwatr Signal is a powerful, lightweight, and modern reactive programming librar
4
4
 
5
5
  It's designed to be simple to learn, yet capable of handling complex state management scenarios.
6
6
 
7
+ [](https://www.google.com/search?q=https://www.npmjs.com/package/%40alwatr/signal)
8
+ [](https://www.google.com/search?q=https://www.npmjs.com/package/%40alwatr/flux)
9
+ [](https://www.google.com/search?q=alwatr+signal)
10
+ [](https://www.google.com/search?q=alwatr+flux)
11
+ [](https://www.google.com/search?q=alwatr)
12
+
7
13
  ## Features
8
14
 
9
15
  - **Type-Safe**: Fully implemented in TypeScript for robust, type-safe code.
@@ -11,7 +17,7 @@ It's designed to be simple to learn, yet capable of handling complex state manag
11
17
  - **Performant**: Smart change detection and batched updates prevent unnecessary computations and re-renders.
12
18
  - **Predictable**: Asynchronous, non-blocking notifications ensure a consistent and understandable data flow.
13
19
  - **Lifecycle Management**: Built-in `destroy()` methods for easy cleanup and memory leak prevention.
14
- - **Easy to Debug**: Unique `signalId` for each signal makes logging and tracing a breeze.
20
+ - **Easy to Debug**: Unique `name` for each signal makes logging and tracing a breeze.
15
21
 
16
22
  ## Core Concepts
17
23
 
@@ -48,13 +54,13 @@ import {StateSignal} from '@alwatr/signal';
48
54
 
49
55
  // A signal to hold the user's first name.
50
56
  const firstName = new StateSignal<string>({
51
- signalId: 'user-firstName',
57
+ name: 'user-firstName',
52
58
  initialValue: 'John',
53
59
  });
54
60
 
55
61
  // A signal to hold a simple counter.
56
62
  const counter = new StateSignal<number>({
57
- signalId: 'app-counter',
63
+ name: 'app-counter',
58
64
  initialValue: 0,
59
65
  });
60
66
  ```
@@ -67,7 +73,7 @@ A `ComputedSignal` combines other signals into a new, read-only value. Let's cre
67
73
  import {ComputedSignal} from '@alwatr/signal';
68
74
 
69
75
  const fullName = new ComputedSignal<string>({
70
- signalId: 'user-fullName',
76
+ name: 'user-fullName',
71
77
  deps: [firstName], // This computed signal depends on firstName.
72
78
  get: () => `User: ${firstName.get()}`,
73
79
  });
@@ -165,7 +171,7 @@ The `subscribe` method accepts an optional second argument to customize its beha
165
171
  ### `StateSignal<T>`
166
172
 
167
173
  - **`constructor(config)`**: Creates a new state signal.
168
- - `config.signalId`: `string`
174
+ - `config.name`: `string`
169
175
  - `config.initialValue`: `T`
170
176
  - **`.get()`**: `T` - Gets the current value.
171
177
  - **`.set(newValue: T)`**: Sets a new value and notifies listeners.
@@ -173,7 +179,7 @@ The `subscribe` method accepts an optional second argument to customize its beha
173
179
  ### `ComputedSignal<T>`
174
180
 
175
181
  - **`constructor(config)`**: Creates a new computed signal.
176
- - `config.signalId`: `string`
182
+ - `config.name`: `string`
177
183
  - `config.deps`: `IReadonlySignal<unknown>[]` - Array of dependency signals.
178
184
  - `config.get`: `() => T` - The function to compute the value.
179
185
  - **`.get()`**: `T` - Gets the current (memoized) value.
@@ -190,7 +196,7 @@ The `subscribe` method accepts an optional second argument to customize its beha
190
196
  ### `EventSignal<T>`
191
197
 
192
198
  - **`constructor(config)`**: Creates a new event signal.
193
- - `config.signalId`: `string`
199
+ - `config.name`: `string`
194
200
  - **`.dispatch(payload: T)`**: Dispatches an event to all listeners.
195
201
 
196
202
  ### Common Methods
@@ -219,6 +225,12 @@ Contributions are welcome! Please read our [contribution guidelines](https://git
219
225
 
220
226
  طراحی آن به گونه‌ای است که یادگیری آن ساده باشد، اما در عین حال قادر به مدیریت سناریوهای پیچیده مدیریت وضعیت نیز باشد.
221
227
 
228
+ [](https://www.google.com/search?q=https://www.npmjs.com/package/%40alwatr/signal)
229
+ [](https://www.google.com/search?q=https://www.npmjs.com/package/%40alwatr/flux)
230
+ [](https://www.google.com/search?q=alwatr+signal)
231
+ [](https://www.google.com/search?q=alwatr+flux)
232
+ [](https://www.google.com/search?q=alwatr)
233
+
222
234
  ## ویژگی‌ها
223
235
 
224
236
  - **ایمنی نوع (Type-Safe)**: به طور کامل با TypeScript پیاده‌سازی شده تا کدی قوی و ایمن از نظر نوع داشته باشید.
@@ -226,7 +238,7 @@ Contributions are welcome! Please read our [contribution guidelines](https://git
226
238
  - **عملکرد بالا**: تشخیص هوشمند تغییرات و به‌روزرسانی‌های دسته‌ای از محاسبات و رندرهای غیرضروری جلوگیری می‌کند.
227
239
  - **پیش‌بینی‌پذیر**: نوتیفیکیشن‌های ناهمزمان (asynchronous) و غیرمسدودکننده (non-blocking) جریان داده‌ای سازگار و قابل فهم را تضمین می‌کنند.
228
240
  - **مدیریت چرخه حیات (Lifecycle)**: متدهای داخلی `destroy()` برای پاک‌سازی آسان و جلوگیری از نشت حافظه (memory leak).
229
- - **اشکال‌زدایی آسان**: شناسه‌های منحصر به فرد (`signalId`) برای هر سیگنال، لاگ‌گیری و ردیابی را بسیار ساده می‌کند.
241
+ - **اشکال‌زدایی آسان**: شناسه‌های منحصر به فرد (`name`) برای هر سیگنال، لاگ‌گیری و ردیابی را بسیار ساده می‌کند.
230
242
 
231
243
  ## مفاهیم اصلی
232
244
 
@@ -263,13 +275,13 @@ import {StateSignal} from '@alwatr/signal';
263
275
 
264
276
  // سیگنالی برای نگهداری نام کوچک کاربر
265
277
  const firstName = new StateSignal<string>({
266
- signalId: 'user-firstName',
278
+ name: 'user-firstName',
267
279
  initialValue: 'John',
268
280
  });
269
281
 
270
282
  // سیگنالی برای نگهداری یک شمارنده ساده
271
283
  const counter = new StateSignal<number>({
272
- signalId: 'app-counter',
284
+ name: 'app-counter',
273
285
  initialValue: 0,
274
286
  });
275
287
  ```
@@ -282,7 +294,7 @@ const counter = new StateSignal<number>({
282
294
  import {ComputedSignal} from '@alwatr/signal';
283
295
 
284
296
  const fullName = new ComputedSignal<string>({
285
- signalId: 'user-fullName',
297
+ name: 'user-fullName',
286
298
  deps: [firstName], // این سیگنال محاسباتی به firstName وابسته است
287
299
  get: () => `User: ${firstName.get()}`,
288
300
  });
@@ -380,7 +392,7 @@ Alwatr Signal از یک مدل ناهمزمان قابل پیش‌بینی بر
380
392
  ### `StateSignal<T>`
381
393
 
382
394
  - **`constructor(config)`**: یک سیگنال وضعیت جدید ایجاد می‌کند.
383
- - `config.signalId`: `string`
395
+ - `config.name`: `string`
384
396
  - `config.initialValue`: `T`
385
397
  - **`.get()`**: `T` - مقدار فعلی را دریافت می‌کند.
386
398
  - **`.set(newValue: T)`**: مقدار جدیدی را تنظیم کرده و شنوندگان را مطلع می‌کند.
@@ -388,7 +400,7 @@ Alwatr Signal از یک مدل ناهمزمان قابل پیش‌بینی بر
388
400
  ### `ComputedSignal<T>`
389
401
 
390
402
  - **`constructor(config)`**: یک سیگنال محاسباتی جدید ایجاد می‌کند.
391
- - `config.signalId`: `string`
403
+ - `config.name`: `string`
392
404
  - `config.deps`: `IReadonlySignal<unknown>[]` - آرایه‌ای از سیگنال‌های وابسته.
393
405
  - `config.get`: `() => T` - تابعی برای محاسبه مقدار.
394
406
  - **`.get()`**: `T` - مقدار فعلی (کش شده) را دریافت می‌کند.
@@ -405,7 +417,7 @@ Alwatr Signal از یک مدل ناهمزمان قابل پیش‌بینی بر
405
417
  ### `EventSignal<T>`
406
418
 
407
419
  - **`constructor(config)`**: یک سیگنال رویداد جدید ایجاد می‌کند.
408
- - `config.signalId`: `string`
420
+ - `config.name`: `string`
409
421
  - **`.dispatch(payload: T)`**: یک رویداد را به تمام شنوندگان ارسال می‌کند.
410
422
 
411
423
  ### متدهای مشترک
@@ -14,12 +14,12 @@ import type { ComputedSignalConfig, IReadonlySignal, SubscribeResult, SubscribeO
14
14
  *
15
15
  * @example
16
16
  * // --- Create dependency signals ---
17
- * const firstName = new StateSignal({ signalId: 'firstName', initialValue: 'John' });
18
- * const lastName = new StateSignal({ signalId: 'lastName', initialValue: 'Doe' });
17
+ * const firstName = new StateSignal({ name: 'firstName', initialValue: 'John' });
18
+ * const lastName = new StateSignal({ name: 'lastName', initialValue: 'Doe' });
19
19
  *
20
20
  * // --- Create a computed signal ---
21
21
  * const fullName = new ComputedSignal({
22
- * signalId: 'fullName',
22
+ * name: 'fullName',
23
23
  * deps: [firstName, lastName],
24
24
  * get: () => `${firstName.get()} ${lastName.get()}`,
25
25
  * });
@@ -43,7 +43,7 @@ export declare class ComputedSignal<T> implements IReadonlySignal<T> {
43
43
  /**
44
44
  * The unique identifier for this signal instance.
45
45
  */
46
- readonly signalId: string;
46
+ readonly name: string;
47
47
  /**
48
48
  * The logger instance for this signal.
49
49
  * @protected
@@ -1 +1 @@
1
- {"version":3,"file":"computed-signal.d.ts","sourceRoot":"","sources":["../../src/core/computed-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AE,eAAe,EAAE,eAAe,EAAE,gBAAgB,EAAC,MAAM,YAAY,CAAC;AAEzG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqCG;AACH,qBAAa,cAAc,CAAC,CAAC,CAAE,YAAW,eAAe,CAAC,CAAC,CAAC;IAmCvC,SAAS,CAAC,OAAO,EAAE,oBAAoB,CAAC,CAAC,CAAC;IAlC7D;;OAEG;IACH,SAAgB,IAAI,SAAqB;IAEzC;;;OAGG;IACH,SAAS,CAAC,QAAQ,CAAC,OAAO,wCAAgD;IAE1E;;;;OAIG;IACH,SAAS,CAAC,QAAQ,CAAC,eAAe,iBAG/B;IAEH;;;OAGG;IAEH,OAAO,CAAC,QAAQ,CAAC,yBAAyB,CAAyB;IAEnE;;;OAGG;IACH,OAAO,CAAC,iBAAiB,CAAS;gBAEL,OAAO,EAAE,oBAAoB,CAAC,CAAC,CAAC;IAW7D;;;;;;OAMG;IACI,GAAG,IAAI,CAAC;IAIf;;;;OAIG;IACH,IAAW,WAAW,IAAI,OAAO,CAEhC;IAED;;;;;;;OAOG;IACI,SAAS,CAAC,QAAQ,EAAE,CAAC,KAAK,EAAE,CAAC,KAAK,IAAI,EAAE,OAAO,CAAC,EAAE,gBAAgB,GAAG,eAAe;IAI3F;;;;OAIG;IACI,SAAS,IAAI,OAAO,CAAC,CAAC,CAAC;IAI9B;;;;;;;;OAQG;IACI,OAAO,IAAI,IAAI;IAqBtB;;;;;;;OAOG;cACa,YAAY,IAAI,OAAO,CAAC,IAAI,CAAC;CAwC9C"}
@@ -14,12 +14,12 @@ import type { EffectSignalConfig, IEffectSignal } from '../type.js';
14
14
  *
15
15
  * @example
16
16
  * // --- Create dependency signals ---
17
- * const counter = new StateSignal({ initialValue: 0, signalId: 'counter' });
18
- * const user = new StateSignal({ initialValue: 'guest', signalId: 'user' });
17
+ * const counter = new StateSignal({ initialValue: 0, name: 'counter' });
18
+ * const user = new StateSignal({ initialValue: 'guest', name: 'user' });
19
19
  *
20
20
  * // --- Create an effect ---
21
21
  * const analyticsEffect = new EffectSignal({
22
- * signalId: 'analytics-effect',
22
+ * name: 'analytics-effect',
23
23
  * deps: [counter, user],
24
24
  * run: () => {
25
25
  * console.log(`Analytics: User '${user.get()}' clicked ${counter.get()} times.`);
@@ -43,7 +43,7 @@ export declare class EffectSignal implements IEffectSignal {
43
43
  /**
44
44
  * The unique identifier for this signal instance.
45
45
  */
46
- readonly signalId: string;
46
+ readonly name: string;
47
47
  /**
48
48
  * The logger instance for this signal.
49
49
  * @protected
@@ -1 +1 @@
1
- {"version":3,"file":"effect-signal.d.ts","sourceRoot":"","sources":["../../src/core/effect-signal.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAC,kBAAkB,EAAE,aAAa,EAAkB,MAAM,YAAY,CAAC;AAEnF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsCG;AACH,qBAAa,YAAa,YAAW,aAAa;IAwC7B,SAAS,CAAC,OAAO,EAAE,kBAAkB;IAvCxD;;OAEG;IACH,SAAgB,QAAQ,SAAkH;IAE1I;;;OAGG;IACH,SAAS,CAAC,QAAQ,CAAC,OAAO,wCAAmD;IAE7E;;;OAGG;IACH,OAAO,CAAC,QAAQ,CAAC,yBAAyB,CAAyB;IAEnE;;;OAGG;IACH,OAAO,CAAC,WAAW,CAAS;IAE5B;;;OAGG;IACH,OAAO,CAAC,aAAa,CAAS;IAE9B;;;;;OAKG;IACH,IAAW,WAAW,IAAI,OAAO,CAEhC;gBAE4B,OAAO,EAAE,kBAAkB;IAiBxD;;;;;;;OAOG;cACa,kBAAkB,IAAI,OAAO,CAAC,IAAI,CAAC;IAmCnD;;;;;;OAMG;IACI,OAAO,IAAI,IAAI;CAmBvB"}
1
+ {"version":3,"file":"effect-signal.d.ts","sourceRoot":"","sources":["../../src/core/effect-signal.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAC,kBAAkB,EAAE,aAAa,EAAkB,MAAM,YAAY,CAAC;AAEnF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsCG;AACH,qBAAa,YAAa,YAAW,aAAa;IAwC7B,SAAS,CAAC,OAAO,EAAE,kBAAkB;IAvCxD;;OAEG;IACH,SAAgB,IAAI,SAAmF;IAEvG;;;OAGG;IACH,SAAS,CAAC,QAAQ,CAAC,OAAO,wCAA8C;IAExE;;;OAGG;IACH,OAAO,CAAC,QAAQ,CAAC,yBAAyB,CAAyB;IAEnE;;;OAGG;IACH,OAAO,CAAC,WAAW,CAAS;IAE5B;;;OAGG;IACH,OAAO,CAAC,aAAa,CAAS;IAE9B;;;;;OAKG;IACH,IAAW,WAAW,IAAI,OAAO,CAEhC;gBAE4B,OAAO,EAAE,kBAAkB;IAmBxD;;;;;;;OAOG;cACa,kBAAkB,IAAI,OAAO,CAAC,IAAI,CAAC;IAmCnD;;;;;;OAMG;IACI,OAAO,IAAI,IAAI;CAmBvB"}
@@ -12,7 +12,7 @@ import type { SignalConfig } from '../type.js';
12
12
  *
13
13
  * @example
14
14
  * // Create a signal for user click events.
15
- * const onUserClick = new EventSignal<{ x: number, y: number }>({ signalId: 'on-user-click' });
15
+ * const onUserClick = new EventSignal<{ x: number, y: number }>({ name: 'on-user-click' });
16
16
  *
17
17
  * // Subscribe to the event.
18
18
  * onUserClick.subscribe(clickPosition => {
@@ -23,7 +23,7 @@ import type { SignalConfig } from '../type.js';
23
23
  * onUserClick.dispatch({ x: 100, y: 250 }); // Notifies the listener.
24
24
  *
25
25
  * // --- Example with no payload ---
26
- * const onAppReady = new EventSignal({ signalId: 'on-app-ready' });
26
+ * const onAppReady = new EventSignal({ name: 'on-app-ready' });
27
27
  * onAppReady.subscribe(() => console.log('Application is ready!'));
28
28
  * onAppReady.dispatch(); // Notifies the listener.
29
29
  */
@@ -1 +1 @@
1
- {"version":3,"file":"event-signal.d.ts","sourceRoot":"","sources":["../../src/core/event-signal.ts"],"names":[],"mappings":"AAGA,OAAO,EAAC,UAAU,EAAC,MAAM,kBAAkB,CAAC;AAE5C,OAAO,KAAK,EAAC,YAAY,EAAC,MAAM,YAAY,CAAC;AAE7C;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,qBAAa,WAAW,CAAC,CAAC,GAAG,IAAI,CAAE,SAAQ,UAAU,CAAC,CAAC,CAAC;IACtD;;;OAGG;IACH,SAAS,CAAC,OAAO,wCAAkD;gBAEhD,MAAM,EAAE,YAAY;IAKvC;;;;;;OAMG;IACI,QAAQ,CAAC,OAAO,EAAE,CAAC,GAAG,IAAI;CAMlC"}
1
+ {"version":3,"file":"event-signal.d.ts","sourceRoot":"","sources":["../../src/core/event-signal.ts"],"names":[],"mappings":"AAGA,OAAO,EAAC,UAAU,EAAC,MAAM,kBAAkB,CAAC;AAE5C,OAAO,KAAK,EAAC,YAAY,EAAC,MAAM,YAAY,CAAC;AAE7C;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,qBAAa,WAAW,CAAC,CAAC,GAAG,IAAI,CAAE,SAAQ,UAAU,CAAC,CAAC,CAAC;IACtD;;;OAGG;IACH,SAAS,CAAC,OAAO,wCAA6C;gBAE3C,MAAM,EAAE,YAAY;IAKvC;;;;;;OAMG;IACI,QAAQ,CAAC,OAAO,EAAE,CAAC,GAAG,IAAI;CAMlC"}
@@ -12,7 +12,7 @@ export declare abstract class SignalBase<T> {
12
12
  * The unique identifier for this signal instance.
13
13
  * Useful for debugging and logging.
14
14
  */
15
- readonly signalId: string;
15
+ readonly name: string;
16
16
  /**
17
17
  * The logger instance for this signal.
18
18
  * @protected
@@ -1 +1 @@
1
- {"version":3,"file":"signal-base.d.ts","sourceRoot":"","sources":["../../src/core/signal-base.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,SAAS,EAAE,gBAAgB,EAAE,eAAe,EAAE,gBAAgB,EAAE,YAAY,EAAC,MAAM,YAAY,CAAC;AAC7G,OAAO,KAAK,EAAC,YAAY,EAAC,MAAM,gBAAgB,CAAC;AAGjD;;;;;GAKG;A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AAqB;IAEzC;;;OAGG;IACH,SAAS,CAAC,QAAQ,CAAC,OAAO,EAAE,YAAY,CAAC;IAEzC;;;OAGG;IACH,SAAS,CAAC,QAAQ,CAAC,UAAU,EAAE,SAAS,CAAC,CAAC,CAAC,EAAE,CAAM;IAEnD;;;OAGG;IACH,OAAO,CAAC,aAAa,CAAS;IAE9B;;;;;OAKG;IACH,IAAW,WAAW,IAAI,OAAO,CAEhC;gBAE4B,OAAO,EAAE,YAAY;IAElD;;;;;OAKG;IACH,SAAS,CAAC,eAAe,CAAC,QAAQ,EAAE,SAAS,CAAC,CAAC,CAAC,GAAG,IAAI;IAcvD;;;;;;;;OAQG;IACI,SAAS,CAAC,QAAQ,EAAE,gBAAgB,CAAC,CAAC,CAAC,EAAE,OAAO,CAAC,EAAE,gBAAgB,GAAG,eAAe;IAoB5F;;;;;;;;OAQG;IACH,SAAS,CAAC,OAAO,CAAC,KAAK,EAAE,CAAC,GAAG,IAAI;IA6BjC;;;;;;;;;;;;OAYG;IACI,SAAS,IAAI,OAAO,CAAC,CAAC,CAAC;IAY9B;;;;;;OAMG;IACI,OAAO,IAAI,IAAI;IAYtB;;;;OAIG;IACH,SAAS,CAAC,eAAe,IAAI,IAAI;CAMlC"}
@@ -12,7 +12,7 @@ import type { StateSignalConfig, ListenerCallback, SubscribeOptions, SubscribeRe
12
12
  * @example
13
13
  * // Create a new state signal with an initial value.
14
14
  * const counter = new StateSignal<number>({
15
- * signalId: 'counter-signal',
15
+ * name: 'counter-signal',
16
16
  * initialValue: 0,
17
17
  * });
18
18
  *
@@ -102,5 +102,6 @@ export declare class StateSignal<T> extends SignalBase<T> implements IReadonlySi
102
102
  * This is crucial for memory management to prevent leaks.
103
103
  */
104
104
  destroy(): void;
105
+ asReadonly(): IReadonlySignal<T>;
105
106
  }
106
107
  //# sourceMappingURL=state-signal.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"state-signal.d.ts","sourceRoot":"","sources":["../../src/core/state-signal.ts"],"names":[],"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C7E;;;OAGG;IACH,OAAO,CAAC,OAAO,CAAI;IAEnB;;;OAGG;IACH,SAAS,CAAC,OAAO,wCAA6C;gBAE3C,MAAM,EAAE,iBAAiB,CAAC,CAAC,CAAC;IAM/C;;;;;;;OAOG;IACI,GAAG,IAAI,CAAC;IAKf;;;;;;;;;;;;;;OAcG;IACI,GAAG,CAAC,QAAQ,EAAE,CAAC,GAAG,IAAI;IAe7B;;;;;;;;;;;;;;OAcG;IACI,MAAM,CAAC,OAAO,EAAE,CAAC,aAAa,EAAE,CAAC,KAAK,CAAC,GAAG,IAAI;IAOrD;;;;;;;;;OASG;IACa,SAAS,CAAC,QAAQ,EAAE,gBAAgB,CAAC,CAAC,CAAC,EAAE,OAAO,GAAE,gBAAqB,GAAG,eAAe;IA2BzG;;;OAGG;IACa,OAAO,IAAI,IAAI;IAKxB,UAAU,IAAI,eAAe,CAAC,CAAC,CAAC;CAGxC"}
@@ -16,11 +16,11 @@ import type { ComputedSignalConfig } from '../type.js';
16
16
  * @returns A new, read-only computed signal.
17
17
  *
18
18
  * @example
19
- * const firstName = createStateSignal({ signalId: 'firstName', initialValue: 'John' });
20
- * const lastName = createStateSignal({ signalId: 'lastName', initialValue: 'Doe' });
19
+ * const firstName = createStateSignal({ name: 'firstName', initialValue: 'John' });
20
+ * const lastName = createStateSignal({ name: 'lastName', initialValue: 'Doe' });
21
21
  *
22
22
  * const fullName = createComputedSignal({
23
- * signalId: 'fullName',
23
+ * name: 'fullName',
24
24
  * deps: [firstName, lastName],
25
25
  * get: () => `${firstName.get()} ${lastName.get()}`,
26
26
  * });
@@ -16,8 +16,8 @@ import type { EffectSignalConfig } from '../type.js';
16
16
  *
17
17
  * @example
18
18
  * // --- Create dependency signals ---
19
- * const counter = createStateSignal({ initialValue: 0, signalId: 'counter' });
20
- * const user = createStateSignal({ initialValue: 'guest', signalId: 'user' });
19
+ * const counter = createStateSignal({ initialValue: 0, name: 'counter' });
20
+ * const user = createStateSignal({ initialValue: 'guest', name: 'user' });
21
21
  *
22
22
  * // --- Create an effect ---
23
23
  * const analyticsEffect = createEffect({
@@ -15,7 +15,7 @@ import type { SignalConfig } from '../type.js';
15
15
  *
16
16
  * @example
17
17
  * const onUserClick = createEventSignal<{ x: number, y: number }>({
18
- * signalId: 'on-user-click'
18
+ * name: 'on-user-click'
19
19
  * });
20
20
  *
21
21
  * onUserClick.subscribe(pos => {
@@ -13,7 +13,7 @@ import type { StateSignalConfig } from '../type.js';
13
13
  *
14
14
  * @example
15
15
  * const counter = createStateSignal({
16
- * signalId: 'counter-signal',
16
+ * name: 'counter-signal',
17
17
  * initialValue: 0,
18
18
  * });
19
19
  *