data

inline fun <T : Data> data(path: String, fallback: () -> T): T

Read JSON Data from a path if it exists; create it otherwise.

Parameters

path

The file path to load/save the data.

fallback

An instance to be used if the file does not exist.