Skip to content

6.x: Rename coroutineScope, refactor BaseComponent lifecycle - #186

Merged
matejsemancik merged 3 commits into
6.xfrom
feature/6.x-polish
Apr 28, 2026
Merged

6.x: Rename coroutineScope, refactor BaseComponent lifecycle#186
matejsemancik merged 3 commits into
6.xfrom
feature/6.x-polish

Conversation

@matejsemancik

Copy link
Copy Markdown
Member

Summary

API polish for 6.x: renames coroutineScope to useCaseScope in CoroutineScopeOwner for clarity, refactors BaseComponent to expose an injectable lifecycleScope, and adds a Result.getOrCancel() extension for cancelling coroutines on failure.

Changes

  • CoroutineScopeOwner.coroutineScopeuseCaseScope (breaking rename — scope is for use cases, not general-purpose use)
  • BaseComponent.componentCoroutineScopelifecycleScope constructor parameter, injectable for tests
  • events flow simplified: removed shareIn wrapper, now bare receiveAsFlow() (single-collector channel)
  • Result.getOrCancel() — new extension that converts a failure into CancellationException
  • Throwable.rootCause made internal

Notes

Breaking changes:

  • CoroutineScopeOwner implementations must rename coroutineScopeuseCaseScope
  • BaseComponent subclasses using componentCoroutineScope must switch to lifecycleScope

@matejsemancik matejsemancik changed the title Rename coroutineScope, refactor BaseComponent lifecycle 6.x: Rename coroutineScope, refactor BaseComponent lifecycle Apr 23, 2026
@matejsemancik
matejsemancik merged commit 4137b28 into 6.x Apr 28, 2026
1 check passed
@matejsemancik
matejsemancik deleted the feature/6.x-polish branch April 28, 2026 10:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants