TypeError: Instance of 'minified:iV<bool>': type 'minified:iV<bool>' is not a subtype of type 'minified:oD<bool>'
if I initialise my ReplaySubject the following way :ReplaySubject<bool> userProvidesLiquidity = ReplaySubject<bool>(maxSize: 1).startWith(false);
@frankpepermans
The getter is just a workaround so that Angular doesn't go into an update loop. On each update cycle, it will invoke your subject.startWith(), this will yield a new Stream instance on every call, causing overflow. If you store the Stream as a reference, as with that getter, you can overcome that issue.
startWith()
that is responsible for such a behaviour ? I kind of expected the same instance to be returned each time as you have noticed.
_login
.map<Request>(_formRequest)
.doOnData((_) {
_attemptLogin.sink.add(true);
})
.asyncMap(Auth.login)
.doOnData((_) {
_attemptLogin.sink.add(false);
})
.listen(_userAuth.sink.add);
I can’t seem to get the latest version to execute the asyncMap()