Skip to content

eaglesakura/lazysingleton

Repository files navigation

What is this?

Lazy init object wrapper.

Example

private val instance: LazySingleton<Foo>()

fun getFoo(context: Context): Foo {
    return instance.get {
        // this block call once.
        // init with Argument.
        Foo(context)
    }
}

How to install

// build.gradle
dependencies {
    implementation 'io.github.eaglesakura.lazysingleton:lazysingleton:+'
}

LICENSE

LICENSE.txt

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages