name

abstract val name: String?

The name of this plugin. The name can be used for logging purposes, but most importantly, to distinguish between different plugins. Name is optional, in which case the plugins will be compared by reference. If you attempt to StoreBuilder.install the same plugin, or different plugins with the same name, multiple times, an exception will be thrown. If you need to have the same plugin installed multiple times, consider giving plugins different names. Plugins that have no name can be installed multiple times, assuming they are different instances of a plugin. Consider the following examples:

loggingPlugin("foo")
analyticsPlugin("foo") // -> will throw

loggingPlugin(null)
analyticsPlugin(null) // -> OK

loggingPlugin("plugin1")
loggingPlugin("plugin1") // -> will throw

loggingPlugin("plugin1")
loggingPlugin("plugin2") // -> OK, but same logs will be printed twice

loggingPlugin(null)
loggingPlugin(null) // -> OK, but same logs will be printed twice

val plugin = loggingPlugin(null)
install(plugin)
install(plugin) // -> will throw