diff --git a/examples/animations_example/pubspec.lock b/examples/animations_example/pubspec.lock index 37437a6d..9be030bd 100644 --- a/examples/animations_example/pubspec.lock +++ b/examples/animations_example/pubspec.lock @@ -184,10 +184,10 @@ packages: dependency: transitive description: name: stack_trace - sha256: "73713990125a6d93122541237550ee3352a2d84baad52d375a4cad2eb9b7ce0b" + sha256: "9f47fd3630d76be3ab26f0ee06d213679aa425996925ff3feffdec504931c377" url: "https://pub.dev" source: hosted - version: "1.11.1" + version: "1.12.0" stream_channel: dependency: transitive description: @@ -232,10 +232,10 @@ packages: dependency: transitive description: name: vm_service - sha256: "5c5f338a667b4c644744b661f309fb8080bb94b18a7e91ef1dbd343bed00ed6d" + sha256: f6be3ed8bd01289b34d679c2b62226f63c0e69f9fd2e50a6b3c1c729a961041b url: "https://pub.dev" source: hosted - version: "14.2.5" + version: "14.3.0" sdks: dart: ">=3.4.0 <4.0.0" flutter: ">=3.18.0-18.0.pre.54" diff --git a/examples/auth_flow/pubspec.lock b/examples/auth_flow/pubspec.lock index 0ab21d06..c7667b98 100644 --- a/examples/auth_flow/pubspec.lock +++ b/examples/auth_flow/pubspec.lock @@ -205,10 +205,10 @@ packages: dependency: transitive description: name: stack_trace - sha256: "73713990125a6d93122541237550ee3352a2d84baad52d375a4cad2eb9b7ce0b" + sha256: "9f47fd3630d76be3ab26f0ee06d213679aa425996925ff3feffdec504931c377" url: "https://pub.dev" source: hosted - version: "1.11.1" + version: "1.12.0" stream_channel: dependency: transitive description: @@ -253,10 +253,10 @@ packages: dependency: transitive description: name: vm_service - sha256: "5c5f338a667b4c644744b661f309fb8080bb94b18a7e91ef1dbd343bed00ed6d" + sha256: f6be3ed8bd01289b34d679c2b62226f63c0e69f9fd2e50a6b3c1c729a961041b url: "https://pub.dev" source: hosted - version: "14.2.5" + version: "14.3.0" sdks: dart: ">=3.4.0 <4.0.0" flutter: ">=3.18.0-18.0.pre.54" diff --git a/examples/clean_architecture/pubspec.lock b/examples/clean_architecture/pubspec.lock index fc416c90..e722815c 100644 --- a/examples/clean_architecture/pubspec.lock +++ b/examples/clean_architecture/pubspec.lock @@ -272,10 +272,10 @@ packages: dependency: transitive description: name: stack_trace - sha256: "73713990125a6d93122541237550ee3352a2d84baad52d375a4cad2eb9b7ce0b" + sha256: "9f47fd3630d76be3ab26f0ee06d213679aa425996925ff3feffdec504931c377" url: "https://pub.dev" source: hosted - version: "1.11.1" + version: "1.12.0" stream_channel: dependency: transitive description: @@ -328,10 +328,10 @@ packages: dependency: transitive description: name: vm_service - sha256: "5c5f338a667b4c644744b661f309fb8080bb94b18a7e91ef1dbd343bed00ed6d" + sha256: f6be3ed8bd01289b34d679c2b62226f63c0e69f9fd2e50a6b3c1c729a961041b url: "https://pub.dev" source: hosted - version: "14.2.5" + version: "14.3.0" web: dependency: transitive description: diff --git a/examples/crud_dio/pubspec.lock b/examples/crud_dio/pubspec.lock index e6d3e13a..afc76b50 100644 --- a/examples/crud_dio/pubspec.lock +++ b/examples/crud_dio/pubspec.lock @@ -549,10 +549,10 @@ packages: dependency: transitive description: name: stack_trace - sha256: "73713990125a6d93122541237550ee3352a2d84baad52d375a4cad2eb9b7ce0b" + sha256: "9f47fd3630d76be3ab26f0ee06d213679aa425996925ff3feffdec504931c377" url: "https://pub.dev" source: hosted - version: "1.11.1" + version: "1.12.0" stream_channel: dependency: transitive description: @@ -621,10 +621,10 @@ packages: dependency: transitive description: name: vm_service - sha256: "5c5f338a667b4c644744b661f309fb8080bb94b18a7e91ef1dbd343bed00ed6d" + sha256: f6be3ed8bd01289b34d679c2b62226f63c0e69f9fd2e50a6b3c1c729a961041b url: "https://pub.dev" source: hosted - version: "14.2.5" + version: "14.3.0" watcher: dependency: transitive description: diff --git a/examples/eval_calculator/pubspec.lock b/examples/eval_calculator/pubspec.lock index d5f1ebaf..9e994026 100644 --- a/examples/eval_calculator/pubspec.lock +++ b/examples/eval_calculator/pubspec.lock @@ -269,10 +269,10 @@ packages: dependency: transitive description: name: stack_trace - sha256: "73713990125a6d93122541237550ee3352a2d84baad52d375a4cad2eb9b7ce0b" + sha256: "9f47fd3630d76be3ab26f0ee06d213679aa425996925ff3feffdec504931c377" url: "https://pub.dev" source: hosted - version: "1.11.1" + version: "1.12.0" stream_channel: dependency: transitive description: @@ -325,10 +325,10 @@ packages: dependency: transitive description: name: vm_service - sha256: "5c5f338a667b4c644744b661f309fb8080bb94b18a7e91ef1dbd343bed00ed6d" + sha256: f6be3ed8bd01289b34d679c2b62226f63c0e69f9fd2e50a6b3c1c729a961041b url: "https://pub.dev" source: hosted - version: "14.2.5" + version: "14.3.0" watcher: dependency: transitive description: diff --git a/examples/flutter_async/pubspec.lock b/examples/flutter_async/pubspec.lock index 37437a6d..9be030bd 100644 --- a/examples/flutter_async/pubspec.lock +++ b/examples/flutter_async/pubspec.lock @@ -184,10 +184,10 @@ packages: dependency: transitive description: name: stack_trace - sha256: "73713990125a6d93122541237550ee3352a2d84baad52d375a4cad2eb9b7ce0b" + sha256: "9f47fd3630d76be3ab26f0ee06d213679aa425996925ff3feffdec504931c377" url: "https://pub.dev" source: hosted - version: "1.11.1" + version: "1.12.0" stream_channel: dependency: transitive description: @@ -232,10 +232,10 @@ packages: dependency: transitive description: name: vm_service - sha256: "5c5f338a667b4c644744b661f309fb8080bb94b18a7e91ef1dbd343bed00ed6d" + sha256: f6be3ed8bd01289b34d679c2b62226f63c0e69f9fd2e50a6b3c1c729a961041b url: "https://pub.dev" source: hosted - version: "14.2.5" + version: "14.3.0" sdks: dart: ">=3.4.0 <4.0.0" flutter: ">=3.18.0-18.0.pre.54" diff --git a/examples/flutter_colorband/pubspec.lock b/examples/flutter_colorband/pubspec.lock index 1ae74168..90c058a9 100644 --- a/examples/flutter_colorband/pubspec.lock +++ b/examples/flutter_colorband/pubspec.lock @@ -533,10 +533,10 @@ packages: dependency: transitive description: name: stack_trace - sha256: "73713990125a6d93122541237550ee3352a2d84baad52d375a4cad2eb9b7ce0b" + sha256: "9f47fd3630d76be3ab26f0ee06d213679aa425996925ff3feffdec504931c377" url: "https://pub.dev" source: hosted - version: "1.11.1" + version: "1.12.0" stream_channel: dependency: transitive description: @@ -613,10 +613,10 @@ packages: dependency: transitive description: name: vm_service - sha256: "5c5f338a667b4c644744b661f309fb8080bb94b18a7e91ef1dbd343bed00ed6d" + sha256: f6be3ed8bd01289b34d679c2b62226f63c0e69f9fd2e50a6b3c1c729a961041b url: "https://pub.dev" source: hosted - version: "14.2.5" + version: "14.3.0" watcher: dependency: transitive description: diff --git a/examples/flutter_counter/pubspec.lock b/examples/flutter_counter/pubspec.lock index 37437a6d..9be030bd 100644 --- a/examples/flutter_counter/pubspec.lock +++ b/examples/flutter_counter/pubspec.lock @@ -184,10 +184,10 @@ packages: dependency: transitive description: name: stack_trace - sha256: "73713990125a6d93122541237550ee3352a2d84baad52d375a4cad2eb9b7ce0b" + sha256: "9f47fd3630d76be3ab26f0ee06d213679aa425996925ff3feffdec504931c377" url: "https://pub.dev" source: hosted - version: "1.11.1" + version: "1.12.0" stream_channel: dependency: transitive description: @@ -232,10 +232,10 @@ packages: dependency: transitive description: name: vm_service - sha256: "5c5f338a667b4c644744b661f309fb8080bb94b18a7e91ef1dbd343bed00ed6d" + sha256: f6be3ed8bd01289b34d679c2b62226f63c0e69f9fd2e50a6b3c1c729a961041b url: "https://pub.dev" source: hosted - version: "14.2.5" + version: "14.3.0" sdks: dart: ">=3.4.0 <4.0.0" flutter: ">=3.18.0-18.0.pre.54" diff --git a/examples/get_it_signals/pubspec.lock b/examples/get_it_signals/pubspec.lock index cc4258b0..644e0ed8 100644 --- a/examples/get_it_signals/pubspec.lock +++ b/examples/get_it_signals/pubspec.lock @@ -205,10 +205,10 @@ packages: dependency: transitive description: name: stack_trace - sha256: "73713990125a6d93122541237550ee3352a2d84baad52d375a4cad2eb9b7ce0b" + sha256: "9f47fd3630d76be3ab26f0ee06d213679aa425996925ff3feffdec504931c377" url: "https://pub.dev" source: hosted - version: "1.11.1" + version: "1.12.0" stream_channel: dependency: transitive description: @@ -253,10 +253,10 @@ packages: dependency: transitive description: name: vm_service - sha256: "5c5f338a667b4c644744b661f309fb8080bb94b18a7e91ef1dbd343bed00ed6d" + sha256: f6be3ed8bd01289b34d679c2b62226f63c0e69f9fd2e50a6b3c1c729a961041b url: "https://pub.dev" source: hosted - version: "14.2.5" + version: "14.3.0" sdks: dart: ">=3.4.0 <4.0.0" flutter: ">=3.18.0-18.0.pre.54" diff --git a/examples/infinite_scroll/pubspec.lock b/examples/infinite_scroll/pubspec.lock index 0e50287d..221881a3 100644 --- a/examples/infinite_scroll/pubspec.lock +++ b/examples/infinite_scroll/pubspec.lock @@ -176,10 +176,10 @@ packages: dependency: transitive description: name: stack_trace - sha256: "73713990125a6d93122541237550ee3352a2d84baad52d375a4cad2eb9b7ce0b" + sha256: "9f47fd3630d76be3ab26f0ee06d213679aa425996925ff3feffdec504931c377" url: "https://pub.dev" source: hosted - version: "1.11.1" + version: "1.12.0" stream_channel: dependency: transitive description: @@ -224,10 +224,10 @@ packages: dependency: transitive description: name: vm_service - sha256: "5c5f338a667b4c644744b661f309fb8080bb94b18a7e91ef1dbd343bed00ed6d" + sha256: f6be3ed8bd01289b34d679c2b62226f63c0e69f9fd2e50a6b3c1c729a961041b url: "https://pub.dev" source: hosted - version: "14.2.5" + version: "14.3.0" sdks: dart: ">=3.4.0 <4.0.0" flutter: ">=3.18.0-18.0.pre.54" diff --git a/examples/node_based_editor/pubspec.lock b/examples/node_based_editor/pubspec.lock index 0e50287d..221881a3 100644 --- a/examples/node_based_editor/pubspec.lock +++ b/examples/node_based_editor/pubspec.lock @@ -176,10 +176,10 @@ packages: dependency: transitive description: name: stack_trace - sha256: "73713990125a6d93122541237550ee3352a2d84baad52d375a4cad2eb9b7ce0b" + sha256: "9f47fd3630d76be3ab26f0ee06d213679aa425996925ff3feffdec504931c377" url: "https://pub.dev" source: hosted - version: "1.11.1" + version: "1.12.0" stream_channel: dependency: transitive description: @@ -224,10 +224,10 @@ packages: dependency: transitive description: name: vm_service - sha256: "5c5f338a667b4c644744b661f309fb8080bb94b18a7e91ef1dbd343bed00ed6d" + sha256: f6be3ed8bd01289b34d679c2b62226f63c0e69f9fd2e50a6b3c1c729a961041b url: "https://pub.dev" source: hosted - version: "14.2.5" + version: "14.3.0" sdks: dart: ">=3.4.0 <4.0.0" flutter: ">=3.18.0-18.0.pre.54" diff --git a/examples/persist_shared_preferences/pubspec.lock b/examples/persist_shared_preferences/pubspec.lock index a1a0c6da..4e35640a 100644 --- a/examples/persist_shared_preferences/pubspec.lock +++ b/examples/persist_shared_preferences/pubspec.lock @@ -301,10 +301,10 @@ packages: dependency: transitive description: name: stack_trace - sha256: "73713990125a6d93122541237550ee3352a2d84baad52d375a4cad2eb9b7ce0b" + sha256: "9f47fd3630d76be3ab26f0ee06d213679aa425996925ff3feffdec504931c377" url: "https://pub.dev" source: hosted - version: "1.11.1" + version: "1.12.0" stream_channel: dependency: transitive description: @@ -349,10 +349,10 @@ packages: dependency: transitive description: name: vm_service - sha256: "5c5f338a667b4c644744b661f309fb8080bb94b18a7e91ef1dbd343bed00ed6d" + sha256: f6be3ed8bd01289b34d679c2b62226f63c0e69f9fd2e50a6b3c1c729a961041b url: "https://pub.dev" source: hosted - version: "14.2.5" + version: "14.3.0" web: dependency: transitive description: diff --git a/examples/shopping_cart/pubspec.lock b/examples/shopping_cart/pubspec.lock index c3288740..0ce1d056 100644 --- a/examples/shopping_cart/pubspec.lock +++ b/examples/shopping_cart/pubspec.lock @@ -229,10 +229,10 @@ packages: dependency: transitive description: name: stack_trace - sha256: "73713990125a6d93122541237550ee3352a2d84baad52d375a4cad2eb9b7ce0b" + sha256: "9f47fd3630d76be3ab26f0ee06d213679aa425996925ff3feffdec504931c377" url: "https://pub.dev" source: hosted - version: "1.11.1" + version: "1.12.0" stream_channel: dependency: transitive description: @@ -277,10 +277,10 @@ packages: dependency: transitive description: name: vm_service - sha256: "5c5f338a667b4c644744b661f309fb8080bb94b18a7e91ef1dbd343bed00ed6d" + sha256: f6be3ed8bd01289b34d679c2b62226f63c0e69f9fd2e50a6b3c1c729a961041b url: "https://pub.dev" source: hosted - version: "14.2.5" + version: "14.3.0" sdks: dart: ">=3.4.0 <4.0.0" flutter: ">=3.18.0-18.0.pre.54" diff --git a/packages/signals/example/pubspec.lock b/packages/signals/example/pubspec.lock index 70eeba03..a993b17d 100644 --- a/packages/signals/example/pubspec.lock +++ b/packages/signals/example/pubspec.lock @@ -179,10 +179,10 @@ packages: dependency: transitive description: name: stack_trace - sha256: "73713990125a6d93122541237550ee3352a2d84baad52d375a4cad2eb9b7ce0b" + sha256: "9f47fd3630d76be3ab26f0ee06d213679aa425996925ff3feffdec504931c377" url: "https://pub.dev" source: hosted - version: "1.11.1" + version: "1.12.0" stream_channel: dependency: transitive description: @@ -227,10 +227,10 @@ packages: dependency: transitive description: name: vm_service - sha256: "5c5f338a667b4c644744b661f309fb8080bb94b18a7e91ef1dbd343bed00ed6d" + sha256: f6be3ed8bd01289b34d679c2b62226f63c0e69f9fd2e50a6b3c1c729a961041b url: "https://pub.dev" source: hosted - version: "14.2.5" + version: "14.3.0" sdks: dart: ">=3.4.0 <4.0.0" flutter: ">=3.18.0-18.0.pre.54" diff --git a/packages/signals_devtools_extension/pubspec.lock b/packages/signals_devtools_extension/pubspec.lock index 25b9157d..48888aac 100644 --- a/packages/signals_devtools_extension/pubspec.lock +++ b/packages/signals_devtools_extension/pubspec.lock @@ -373,10 +373,10 @@ packages: dependency: transitive description: name: stack_trace - sha256: "73713990125a6d93122541237550ee3352a2d84baad52d375a4cad2eb9b7ce0b" + sha256: "9f47fd3630d76be3ab26f0ee06d213679aa425996925ff3feffdec504931c377" url: "https://pub.dev" source: hosted - version: "1.11.1" + version: "1.12.0" stream_channel: dependency: transitive description: @@ -501,10 +501,10 @@ packages: dependency: transitive description: name: vm_service - sha256: "5c5f338a667b4c644744b661f309fb8080bb94b18a7e91ef1dbd343bed00ed6d" + sha256: f6be3ed8bd01289b34d679c2b62226f63c0e69f9fd2e50a6b3c1c729a961041b url: "https://pub.dev" source: hosted - version: "14.2.5" + version: "14.3.0" web: dependency: transitive description: diff --git a/packages/signals_flutter/example/pubspec.lock b/packages/signals_flutter/example/pubspec.lock index 9bdbcc58..2d7c20cf 100644 --- a/packages/signals_flutter/example/pubspec.lock +++ b/packages/signals_flutter/example/pubspec.lock @@ -131,7 +131,7 @@ packages: url: "https://pub.dev" source: hosted version: "1.9.0" - preact_signals: + signals_core: dependency: transitive description: name: preact_signals @@ -170,10 +170,10 @@ packages: dependency: transitive description: name: stack_trace - sha256: "73713990125a6d93122541237550ee3352a2d84baad52d375a4cad2eb9b7ce0b" + sha256: "9f47fd3630d76be3ab26f0ee06d213679aa425996925ff3feffdec504931c377" url: "https://pub.dev" source: hosted - version: "1.11.1" + version: "1.12.0" stream_channel: dependency: transitive description: @@ -218,10 +218,10 @@ packages: dependency: transitive description: name: vm_service - sha256: "5c5f338a667b4c644744b661f309fb8080bb94b18a7e91ef1dbd343bed00ed6d" + sha256: f6be3ed8bd01289b34d679c2b62226f63c0e69f9fd2e50a6b3c1c729a961041b url: "https://pub.dev" source: hosted - version: "14.2.5" + version: "14.3.0" sdks: dart: ">=3.3.0 <4.0.0" flutter: ">=3.18.0-18.0.pre.54" diff --git a/packages/signals_flutter/lib/extended.dart b/packages/signals_flutter/lib/extended.dart index 852d51cb..d059157f 100644 --- a/packages/signals_flutter/lib/extended.dart +++ b/packages/signals_flutter/lib/extended.dart @@ -5,3 +5,4 @@ export 'src/extended/widgets.dart'; export 'src/extended/material.dart'; export 'src/extended/widgets_binding.dart'; export 'src/extended/scheduler_binding.dart'; +export 'src/extensions/untracked_value.dart'; \ No newline at end of file diff --git a/packages/signals_flutter/lib/src/extensions/untracked_value.dart b/packages/signals_flutter/lib/src/extensions/untracked_value.dart new file mode 100644 index 00000000..84eecd97 --- /dev/null +++ b/packages/signals_flutter/lib/src/extensions/untracked_value.dart @@ -0,0 +1,13 @@ +import 'package:signals_core/signals_core.dart'; + +/// Signal extensions +extension ReadonlySignalUntrackedValueUtils on ReadonlySignal { + /// Runs a callback function that returns the signal value without + /// subscribing to the signal updates. + /// + /// ```dart + /// final counter = signal(0); + /// final untrackedValue = counter.untrackedValue; + /// ``` + T get untrackedValue => untracked(() => value); +} diff --git a/packages/signals_flutter/test/extension/untracked_value_test.dart b/packages/signals_flutter/test/extension/untracked_value_test.dart new file mode 100644 index 00000000..42ad8184 --- /dev/null +++ b/packages/signals_flutter/test/extension/untracked_value_test.dart @@ -0,0 +1,34 @@ +import 'package:flutter_test/flutter_test.dart'; +import 'package:signals_flutter/extended.dart'; +import 'package:signals_flutter/signals_flutter.dart'; + +void main() { + SignalsObserver.instance = null; + group('untrackedValue', () { + test('single', () { + final s = signal(0); + int calls = 0; + final dis = effect(() { + s.value; + s.untrackedValue + 1; + calls++; + }); + dis(); + + expect(calls, 1); + }); + + test('nested', () { + final s = signal(0); + int calls = 0; + final dis = effect(() { + s.value; + untracked(() => s.untrackedValue + 1); + calls++; + }); + dis(); + + expect(calls, 1); + }); + }); +}