@libs-ui/pipes-convert-signal-to-object 0.2.357-7 → 0.2.357-9

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 (2) hide show
  1. package/README.md +4 -11
  2. package/package.json +2 -2
package/README.md CHANGED
@@ -287,9 +287,10 @@ import { LibsUiPipesConvertSignalToObjectPipe } from '@libs-ui/pipes-convert-sig
287
287
  // Pipe transform signature
288
288
  // transform(data: any, isCloneDeep?: boolean): any
289
289
 
290
- // dụ kiểu tường minh khi inject để dùng trong TS
291
- const result: { name: string; age: number } =
292
- this.convertPipe.transform<{ name: string; age: number }>(this.userSignal);
290
+ // Lưu ý: transform(data: any, isCloneDeep?: boolean): any KHÔNG phải generic method
291
+ // không được viết transform<T>(...), TypeScript sẽ báo lỗi compile.
292
+ // Muốn type ràng, ép kiểu (cast) kết quả trả về:
293
+ const result = this.convertPipe.transform(this.userSignal) as { name: string; age: number };
293
294
  ```
294
295
 
295
296
  ## Lưu ý quan trọng
@@ -303,11 +304,3 @@ const result: { name: string; age: number } =
303
304
  ⚠️ **Pipe chỉ unwrap — không làm reactive**: Kết quả trả về là snapshot tại thời điểm pipe chạy. Nếu signal thay đổi sau đó, cần pipe chạy lại (Angular change detection sẽ tự kích hoạt trong template với OnPush khi signal thay đổi).
304
305
 
305
306
  ⚠️ **Dùng với inject khi cần trong TypeScript**: Để dùng ngoài template, khai báo trong `providers` của component và inject bằng `inject(LibsUiPipesConvertSignalToObjectPipe)`.
306
-
307
- ## Demo
308
-
309
- ```bash
310
- npx nx serve core-ui
311
- ```
312
-
313
- Truy cập: http://localhost:4500/pipes/convert-signal-to-object
package/package.json CHANGED
@@ -1,9 +1,9 @@
1
1
  {
2
2
  "name": "@libs-ui/pipes-convert-signal-to-object",
3
- "version": "0.2.357-7",
3
+ "version": "0.2.357-9",
4
4
  "peerDependencies": {
5
5
  "@angular/core": ">=18.0.0",
6
- "@libs-ui/utils": "0.2.357-7"
6
+ "@libs-ui/utils": "0.2.357-9"
7
7
  },
8
8
  "sideEffects": false,
9
9
  "module": "fesm2022/libs-ui-pipes-convert-signal-to-object.mjs",