setGlobal

fun setGlobal(promptModel: PromptModel?)

Sets a PromptModel which will be returned for every get call regardless of the current coroutine scope.

This is intended to only be used in situations where there is no coroutine scope available, for example when using this library from Swift. For applications written entirely in Kotlin, do not use this, instead inject the PromptModel in the current coroutine scope like this:

CoroutineScope(Dispatchers.IO + myPromptModel).launch {
// code here which will want to show prompts using PromptModel.get()
}

Parameters

promptModel

the global PromptModel to set or null to clear it.