Skip to content

Setting disk cache directory when using coil3 in multiplatform compose. #2082

Closed Answered by mainrs
mainrs asked this question in Q&A
Discussion options

You must be logged in to vote

Not sure if this is the best way to do it, but I used this method to change the global ImageLoader instance.

fun setSingletonImageLoaderFactory(factory: (context: PlatformContext) -> ImageLoader) {
// This can't be invoked inside a LaunchedEffect as it needs to run immediately before
// SingletonImageLoader.get is called by any composables.
SingletonImageLoader.setSafe(factory)
}

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by mainrs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant