Closed fummicc1 closed 1 year ago
@sidepelican
I'm in no hurry but could you review this PR when you have time :pray:
This change looks good, but I don't want to expand the Combine related functions.
In case of #175, it can also be avoided by using the --disable-combine-default-values
option. This change doesn't seem necessary.
If we are going to be hospitable to #175, I think it would be to display warning messages when the CurrentValueSubject fall through implicitly to the PassthroughSubject.
On that time, it would also be good to display the existence of the --disable-combine-default-values
option.
Yes. honestly, I did not know that flag. It is what I would like! Thank you.
it would be to display warning messages when the CurrentValueSubject fall through implicitly to the PassthroughSubject.
I will try to address to show the warning message instead of this PR. 👍
close because other solution already exists.
Overview
I added new metadata to set an explicit default value for CurrentValueSubject in a Mock object, which is used to manage the Publisher stream.
Problem
Currently, if publish type ( type
A
ofPublisher<A, B>
) is not kind of primitive type, subject becomesPassthroughSubject
even if you mark it asCurrentValueSubject
by@mockable(combine: aPublisher = CurrentValueSubject)
.Note
This PR only addresses Combine, but RxSwift also has the same problem. I believe this should be considered a separate issue because the implementation differs from the Combine one.
Example