You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Release v5.2.1: Improved coverage and code cleanup
Internal Changes:
- Removed eager initialization from operator chains (now true lazy init)
- Chains only subscribe to sources when first listener is added
- Cleaned up redundant init() calls from constructors
- Converted constructors to use super parameters
Documentation:
- Updated terminology from "hot subscription model" to "lazy initialization"
- Updated README.md, best_practices.md, and operators/overview.md
- Clearer explanation of chain lifecycle behavior
Tests:
- Improved test coverage from 83.7% to 97.6% (+13.9 points)
- Added comprehensive lazy initialization tests
- Added tests for timer cancellation, error handling, disposal
- Fixed misleading test names
- All 199 tests pass
Code Quality:
- Fixed all analyzer warnings
- All code properly formatted
Copy file name to clipboardExpand all lines: README.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -32,7 +32,7 @@ Previously published as `functional_listener`. Now includes reactive collections
32
32
33
33
[Learn more about listen_it →](https://flutter-it.dev/documentation/listen_it/listen_it)
34
34
35
-
> ⚠️**Important:** Operator chains use a "hot" subscription model. See the [best practices guide](https://flutter-it.dev/documentation/listen_it/best_practices) to avoid memory leaks when creating chains inline. TL;DR: Use watch_it (automatic caching!) or create chains outside build methods.
35
+
> 💡**Performance Tip:** Operator chains use lazy initialization - they only subscribe to their sources when you add a listener. Once initialized, chains stay subscribed for efficiency. For best practices with watch_it integration, see the [complete documentation](https://flutter-it.dev/documentation/listen_it/best_practices).
36
36
37
37
## Quick Start
38
38
@@ -197,7 +197,7 @@ Transform and combine observables:
Operator chains (like `source.map(...).where(...)`) use a **"hot" subscription model** - they subscribe to their source immediately and stay subscribed even with zero listeners.
200
+
Operator chains (like `source.map(...).where(...)`) use **lazy initialization** - they only subscribe to their source when the first listener is added, then stay subscribed for efficiency.
201
201
202
202
**This can cause memory leaks if chains are created inline in build methods!**
Copy file name to clipboardExpand all lines: pubspec.yaml
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
name: listen_it
2
2
description: Reactive primitives for Flutter - observable collections and powerful operators. Work with ValueNotifiers like Streams. Includes ListNotifier, MapNotifier, SetNotifier. Previously published as functional_listener.
0 commit comments