I've managed to create it this way:
private final PublishSubject<Void> subject = PublishSubject.create();
But how to pass value to it in onNext(T t)? I can't pass null to it, cause it will throw an exception. onComplete isn't an option too.
I've managed to create it this way:
private final PublishSubject<Void> subject = PublishSubject.create();
But how to pass value to it in onNext(T t)? I can't pass null to it, cause it will throw an exception. onComplete isn't an option too.
Copyright © 2021 Jogjafile Inc.
Nulls are generally not allowed in 2.x thus a
Voidtype won't let you emit anyonNext(null)unlike 1.x. If you think you needVoidas your element type, it indicates you don't care about what elements are just that you want to react to something over and over.For this case, you can instead use any other type and signal any value. In the wiki there is an example you can adapt: