Skip to content

Commit 29e5288

Browse files
authored
feat(utils): Improved Lazy utility (#259)
1 parent 6328ff4 commit 29e5288

File tree

3 files changed

+905
-14
lines changed

3 files changed

+905
-14
lines changed
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
---
2+
"@inox-tools/utils": minor
3+
---
4+
5+
Improved Lazy utility with new features:
6+
7+
- Added circular dependency detection that throws a clear error when a Lazy value tries to access itself during initialization
8+
- Implemented Promise interface (`then`, `catch`, `finally`) allowing Lazy instances to be awaited directly
9+
- Added attachment system for side effects: `attach()` registers callbacks when values are computed, `chain()` creates derived Lazy instances
10+
- Added static methods for working with multiple lazies: `attachMulti`, `chainMulti`, `attachAll`, `chainAll`
11+
- Added new `LazyKeyed` class for managing keyed lazy values with per-key memoization, attachments, and chaining

0 commit comments

Comments
 (0)