diff --git a/orx-olive/README.md b/orx-olive/README.md index 18cdeac5..97920eec 100644 --- a/orx-olive/README.md +++ b/orx-olive/README.md @@ -60,6 +60,8 @@ import org.openrndr.draw.* } } ``` +The Reloadable store can be cleared using the `clearReloadables` function + Keep in mind that `Reloadable` should only be used for singleton classes. ## Persistent Data diff --git a/orx-olive/src/main/kotlin/Reloadable.kt b/orx-olive/src/main/kotlin/Reloadable.kt index f801c4d0..eb83c3f5 100644 --- a/orx-olive/src/main/kotlin/Reloadable.kt +++ b/orx-olive/src/main/kotlin/Reloadable.kt @@ -7,6 +7,13 @@ import kotlin.reflect.jvm.jvmName private val store = mutableMapOf() +/** + * Clear reloadable values + */ +fun clearReloadables() { + store.clear() +} + /** * A class with which persistent state can be reloaded from inside Olive scripts. */