SuspendLazy

interface SuspendLazy<T>

Use this like a lazy, but because operator getValue cannot be suspend, you'll have to invoke this object instead in a suspend context to receive the value.

Use when you want a lazy that is loaded via a suspend fun and you use it in a suspend fun which can tolerate loading the value on a miss.

Functions

Link copied to clipboard
abstract suspend operator fun invoke(): T

Obtain the value of SuspendLazy. Will invoke the initializer on first try.