kotlin-datastore / org.khanacademy.datastore / get

get

inline fun <reified T : Keyed<T>> Datastore.get(key: Key<T>): T?

Synchronous get by key of an object from the datastore.

Will throw if we retrieve an entity from the datastore and we can't convert it to type T, but will return null if nothing is found in the datastore.

For technical reasons, this is implemented out of line, below.