Closed zulkis closed 5 years ago
valuesReceived should be cleaned up before sending value.
If we have subscription and creating another subscription on the same RACReplaySubject while -take:1 it - we can get first value instead of second.
RACReplaySubject *subject = [RACReplaySubject replaySubjectWithCapacity:1]; [subject subscribeNext:^(id _Nullable item1) { NSLog(@"%@", item1); [[subject take:1] subscribeNext:^(id _Nullable item2) { NSLog(@"%@", item2); }]; }]; [subject sendNext:@"first"]; [subject sendNext:@"second"];
Expected:
first first second second
Got:
first first second first
That seems reasonable. Can you add a test?
Will do. Still, I am not sure why one MR check is failing because of some validation error. Any advice on it?
Things look good here. Thanks!
valuesReceived should be cleaned up before sending value.
If we have subscription and creating another subscription on the same RACReplaySubject while -take:1 it - we can get first value instead of second.
Expected:
Got: