feat: add NetworkMockResourceLoader fun interface#59
Merged
Conversation
MaxMichel2
force-pushed
the
feat/networkmock-resource-loader-interface
branch
from
July 20, 2026 18:15
b1d4d2f to
970563d
Compare
Replaces the raw `suspend (String) -> ByteArray` lambda with a named fun interface in devview-networkmock-core. Gives DI frameworks a type to bind, eliminating boilerplate in multi-module KMP projects where mock files live in a different module than where NetworkMock is constructed. Both -networkmock and -ktor switch their -core dependency to api() so the type is visible to all integrators. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
MaxMichel2
force-pushed
the
feat/networkmock-resource-loader-interface
branch
from
July 21, 2026 09:22
970563d to
b1bb0f0
Compare
matthiaslao
approved these changes
Jul 21, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
NetworkMockResourceLoaderfun interface indevview-networkmock-core, giving DI frameworks (Koin, Hilt, etc.) a named type to binddevview-networkmockanddevview-networkmock-ktorfromimplementationtoapifordevview-networkmock-core, so the type is transitively visible to all integratorsMockConfigRepository,NetworkMockInitializer, andNetworkMockto use the new type throughout; existing lambda call sites continue to work via SAM conversionMotivation
In multi-module KMP projects, Compose Resources are module-scoped. When mock files live in a different module (e.g.
data) than whereNetworkMockis constructed (e.g.presentation), integrators previously had to define their own bridge interface, implementation, and DI binding — 3 files. WithNetworkMockResourceLoaderavailable as a named type, that collapses to a single DI binding:Test plan
compileAndroidMainclean on-coreand-networkmocktestAndroidHostTest) passes — 284 tasksdetektFullpasses🤖 Generated with Claude Code