Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

johnsonlee/once

Repository files navigation

Once

A library to make sure code blocks are executed only once

Getting Started

Configuring the dependencies:

dependencies {
    implementation("io.johnsonlee:once:1.1.0")
}

Then, you can use it in your code:

class Gretting {

  val once = Once<Unit>()
  
  fun hello(name: String): Unit = once {
    println("Hello, ${name}")
  }

}

About

A library to make sure code blocks are executed only once

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages