I need ReplaySubject wrapper like Variable. I felt we need this wrapper because Variable is required initial value.
Variable<E?> is not good way to avoid set initial value. Variable<E?> publish nil first, we need filter it and maybe it's a little bit annoying. And somebody can set nil again, but we need nil only when initialize Variable. In my opinion, it's better that if compiler prevent set nil again.ReplaySubject<E> is better, but I hope to get more useful features like a Variable. UIView or UIViewController subclass using Nib/Storyboard.I am using this feature on our code base, and we name it LazyVariable.
Hi, @tarunon
To be honest I'm don't like that Variable is in the main repo at all :)
I've seen so many times people abuse it :)
Also there are several ways to ensure you have latest value on subscription by using Driver, shareReplay, withLatestFrom ...
So I would not want this feature to be in the main repo :)
Hi guys,
yeah, I agree with @sergdort , if it's not core functionality, not a declarative concept, not consistent with other rx implementations and can be easily accomplished by using public interface, it's probably not a good idea to include it in this repo.
Sorry @tarunon . We have already too much code to maintain :)
@kzaher @sergdort Thanks discussion, I understood it.
Most important thing is Variable has no Error. And now I find pr that PublishSubject wrapper, maybe it will be good for me.
Btw, I have a question.
I think Variable being in the main repo make a lot of confusing and misunderstanding, and I had misunderstood also.
Is there a load map of branching Variable to another repository?
@tarunon I think that with time we will probably move it somewhere else.
Right now moving it would probably cause too much confusion, and we have a lot of things to polish.
I'm also hoping that with time there will maybe exist some cross library concept equivalent to BehaviorSubject but with far less exotic name.
And Swift 4.0 is coming :)
@kzaher Sure! Thank you explaining ~
Most helpful comment
Hi, @tarunon
To be honest I'm don't like that
Variableis in the main repo at all :)I've seen so many times people abuse it :)
Also there are several ways to ensure you have latest value on subscription by using
Driver,shareReplay,withLatestFrom...So I would not want this feature to be in the main repo :)