We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Consider the following example:
let periodic = SafeSignal<Int>(sequence: 0..., interval: 1.0) .map(String.init) .debug("periodic") let initial = SafeSignal(just: "0") initial.append(periodic) .prefix(maxLength: 3) .debug("final") .observeNext { _ in } .dispose(in: bag)
If we run it, here is what will be printed out:
[final] started [final] next(0) [periodic] started [periodic] next(0) [final] next(0) [periodic] next(1) [final] next(1) [final] finished [final] disposed [periodic] next(2) [periodic] next(3) [periodic] next(4) [periodic] next(5) ...
So as you can see the periodic signal was not disposed and keeps producing elements.
periodic
Furthermore, if we replace append(periodic) with merge(with: periodic) it is disposed correctly:
append(periodic)
merge(with: periodic)
[final] started [final] next(0) [periodic] started [periodic] next(0) [final] next(0) [periodic] next(1) [final] next(1) [periodic] disposed [final] finished [final] disposed
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Consider the following example:
If we run it, here is what will be printed out:
So as you can see the
periodic
signal was not disposed and keeps producing elements.Furthermore, if we replace
append(periodic)
withmerge(with: periodic)
it is disposed correctly:The text was updated successfully, but these errors were encountered: