Skip to content

Instantly share code, notes, and snippets.

@skydoves
Created March 28, 2026 01:14
Show Gist options
  • Select an option

  • Save skydoves/b746ec801cd53a4f382706499abd5d10 to your computer and use it in GitHub Desktop.

Select an option

Save skydoves/b746ec801cd53a4f382706499abd5d10 to your computer and use it in GitHub Desktop.
ImagePluginComponent DSL
@Stable
public class ImagePluginComponent(
internal val mutablePlugins: MutableList<ImagePlugin> = mutableListOf(),
) : ImageComponent {
public val plugins: List<ImagePlugin>
inline get() = mutablePlugins
public fun add(imagePlugin: ImagePlugin): ImagePluginComponent = apply {
mutablePlugins.add(imagePlugin)
}
public operator fun ImagePlugin.unaryPlus(): ImagePluginComponent = add(this)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment