Replies: 1 comment 1 reply
-
Try doing .toList() after the where() because it currently is a lazy iterable |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Here's a test with a
listSignal
as source.It will create a
select
that allows only blueIf two blue pass the filter then add a green to original signal and dispose
select
I cannot figure out the output as it add a second green after it dipose and specific logs.
Thanks a lot for any advice on how to model that.
I can move
s.add('green');
toonDispose
to avoid the doublon but trying to understand the second call.Probably expecting than calling
dispose()
will unsub further events.`
cps: (blue)
cps: (blue)
after red: [red, blue, red] / (blue)
cps: (blue, blue)
grant a green
==>disposed
computed warning: [421|select] has been read after disposed: #0 Computed.value (package:signals_core/src/core/computed.dart:522:97)
#1 ReadonlySignal.subscribe. (package:signals_core/src/core/readonly.dart:95:26)
#2 Effect._callback (package:signals_core/src/core/effect.dart:258:32)
#3 _endBatch (package:signals_core/src/core/batch.dart:29:18)
#4 Signal.set (package:signals_core/src/core/signal.dart:513:7)
#5 ListSignal.add (package:signals_core/src/value/list.dart:77:5)
#6 main.. (file:///Users/robbie/Documents/Dev/flutter_playboard/board_logic/test/resource_test.dart:128:9)
#7 Declarer.test.. (package:test_api/src/backend/declarer.dart:215:19)
#8 Declarer.test. (package:test_api/src/backend/declarer.dart:213:7)
#9 Invoker._waitForOutstandingCallbacks. (package:test_api/src/backend/invoker.dart:258:9)
cps: (blue, blue)
grant a green
computed warning: [421|select] has been read after disposed: #0 Computed.value (package:signals_core/src/core/computed.dart:522:97)
#1 ReadonlySignal.toString (package:signals_core/src/core/readonly.dart:51:26)
#2 _StringBase._interpolate (dart:core-patch/string_patch.dart:871:19)
#3 main.. (file:///Users/robbie/Documents/Dev/flutter_playboard/board_logic/test/resource_test.dart:129:35)
#4 Declarer.test.. (package:test_api/src/backend/declarer.dart:215:19)
#5 Declarer.test. (package:test_api/src/backend/declarer.dart:213:7)
#6 Invoker._waitForOutstandingCallbacks. (package:test_api/src/backend/invoker.dart:258:9)
after blue: [red, blue, red, blue, green, green] / (blue, blue)
computed warning: [421|select] has been read after disposed: #0 Computed.value (package:signals_core/src/core/computed.dart:522:97)
#1 ReadonlySignal.toString (package:signals_core/src/core/readonly.dart:51:26)
#2 _StringBase._interpolate (dart:core-patch/string_patch.dart:871:19)
#3 main.. (file:///Users/robbie/Documents/Dev/flutter_playboard/board_logic/test/resource_test.dart:131:23)
#4 Declarer.test.. (package:test_api/src/backend/declarer.dart:215:19)
#5 Declarer.test. (package:test_api/src/backend/declarer.dart:213:7)
#6 Invoker._waitForOutstandingCallbacks. (package:test_api/src/backend/invoker.dart:258:9)
[red, blue, red, blue, green, green] / (blue, blue)
`
Beta Was this translation helpful? Give feedback.
All reactions