Skip to content

Commit c4e0ceb

Browse files
committed
fix: Return injected factory in singleConfig
1 parent 82df85b commit c4e0ceb

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

  • idofront-features/src/main/kotlin/com/mineinabyss/idofront/features

idofront-features/src/main/kotlin/com/mineinabyss/idofront/features/InjectHelpers.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,13 +35,13 @@ import kotlin.io.path.div
3535
inline fun <reified T : Any> MutableDI.singleConfig(
3636
path: String,
3737
crossinline configure: ConfigBuilder<T>.() -> Unit = {},
38-
) {
38+
): InjectedValue<T> {
3939
val configHolder by single<SingleConfig<T>> {
4040
val plugin = get<Plugin>()
4141
config<T> { configure() }.single(plugin.dataPath / path)
4242
}
4343
var cache = configHolder.read() to Bukkit.getCurrentTick()
44-
factory<T> {
44+
return factory<T> {
4545
val currentTick = Bukkit.getCurrentTick()
4646
val (data, lastRead) = cache
4747
if (currentTick == lastRead) return@factory data

0 commit comments

Comments
 (0)