readKlip

fun readKlip(path: String, key: String, source: () -> String): String

Reads a klip from a klip file specified by path under given key. If such klip is not found, a value provided by source is persisted and returned instead.

Return

read klip if it exists or persisted value that was provided by source otherwise

Parameters

path

file path to retrieve and save klip for the given context

key

key to read or write the klip under in the file at path

source

a provider for a string representation to persist