Action icon indicating copy to clipboard operation
Action copied to clipboard

Fix `Actions.elements` does not emit values

Open Econa77 opened this issue 3 years ago • 4 comments

Fixed #216

I encountered a case similar to the issue ( #216 ) and committed testing and a temporary fix. It seems that the values does not emit if the timing to subscribe the elements is after the input.

I don't think this fix is so good, so does anyone have any other ideas?

Econa77 avatar Apr 13 '21 15:04 Econa77

Warnings
:warning: It looks like code was changed without adding anything to the Changelog. If this is a trivial PR that doesn't need a changelog, add #trivial to the PR title or body.

Generated by :no_entry_sign: dangerJS

rxswiftcommunity[bot] avatar Apr 13 '21 15:04 rxswiftcommunity[bot]

It's been a while since I used RxSwift day-to-day... is this a bad solution just because of the .share()? We can definitely find someone closer to the code than me to review this 👍

ashfurrow avatar Apr 14 '21 14:04 ashfurrow

@ashfurrow I think the bad solution is an empty subscribe to keep the values emitting.

elements
    .subscribe()
    .disposed(by: disposeBag)

This is necessary to subscribe to the values at any time, but it difficult to understand why this empty subscribe is needed on code.

Econa77 avatar Apr 14 '21 15:04 Econa77

Any update?

RobertDresler avatar Aug 24 '21 15:08 RobertDresler