diff --git a/startup/launcher/src/jsMain/kotlin/CreateStartupPluginAndRegister.kt b/startup/plugin/src/jsMain/kotlin/CreateStartupPluginAndRegister.kt similarity index 55% rename from startup/launcher/src/jsMain/kotlin/CreateStartupPluginAndRegister.kt rename to startup/plugin/src/jsMain/kotlin/CreateStartupPluginAndRegister.kt index f1a743db4e7..e8ea6b511ed 100644 --- a/startup/launcher/src/jsMain/kotlin/CreateStartupPluginAndRegister.kt +++ b/startup/plugin/src/jsMain/kotlin/CreateStartupPluginAndRegister.kt @@ -1,14 +1,14 @@ -package dev.inmo.micro_utils.startup.launcher - -import dev.inmo.micro_utils.startup.plugin.StartPlugin -import dev.inmo.micro_utils.startup.plugin.StartPluginSerializer +package dev.inmo.micro_utils.startup.plugin /** * Creates [T] using [block], register it in [StartPluginSerializer] using its [StartPluginSerializer.registerPlugin] * and returns created by [block] plugin + * + * @param name Will be used as a key for registration in [StartPluginSerializer] and will be passed to the [block] as + * parameter */ -inline fun createStartupPluginAndRegister(name: String, block: () -> T): T { - val plugin = block() +inline fun createStartupPluginAndRegister(name: String, block: (String) -> T): T { + val plugin = block(name) StartPluginSerializer.registerPlugin(name, plugin) return plugin }