Write correct coroutine scopes, Flow collection, and dispatcher injection in Android. Use when writing suspend functions, choosing between StateFlow and SharedFlow, or injecting Dispatchers for testability.
71
—
Does it follow best practices?
Impact
—
No eval scenarios have been run
Passed
No known issues
viewModelScope (VM) or lifecycleScope (Activity/Fragment).DispatcherProvider) for testability. not hardcode Dispatchers.IO.Flow for data streams.StateFlow (State) or SharedFlow (Events).SharedFlow with replay only when late subscribers must receive recent events.collectAsStateWithLifecycle() (Compose) or repeatOnLifecycle (Views).611f52a
If you maintain this skill, you can claim it as your own. Once claimed, you can manage eval scenarios, bundle related skills, attach documentation or rules, and ensure cross-agent compatibility.