Skip to content

fix: Idempotent start#23

Open
plajdo wants to merge 2 commits intomainfrom
fix/idempotent-start
Open

fix: Idempotent start#23
plajdo wants to merge 2 commits intomainfrom
fix/idempotent-start

Conversation

@plajdo
Copy link
Copy Markdown
Contributor

@plajdo plajdo commented Apr 25, 2026

Added check whether any subscriptions for current Reactor are active. This makes start function idempotent for callers, and effectively prevents creating duplicate subscriptions.

Condition: transform function must be free of side effects, as empty transform will be called multiple times, until first subscription is created for the Reactor.


Disabled auto-start of AnyReactor type-erased type.
Previously this auto-start behaviour caused incorrectly stored Combine/non-combine subscriptions to external events from viewModels. Subscriptions were being stored under the wrapper type, which caused confusion and non-clear event routing.


Effects:

Call to viewModel.start() now has to be explicit and will always be forwarded to correct concrete Reactor type.

@plajdo plajdo requested a review from andrej-jasso April 25, 2026 15:59
@plajdo plajdo self-assigned this Apr 25, 2026
@plajdo plajdo added the bug Something isn't working label Apr 25, 2026
@plajdo plajdo requested a review from MatusMistrik April 25, 2026 17:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant