forceMutable

fun <T> T.forceMutable(onChange: suspend (old: T, new: T) -> Unit = { _, _ -> }): Mutable<T>(source)

Deprecated

Bypasses mutable checks, prefer mutable()

绕过 mutable 的安全检查,强制使用 Mutable 包装一个类型。

这意味着只要通过 getupdate 拿到对数据的引用,就可随意更新而绕过 update 中的 mutex 保护和 onChange

update / set / onChange 在此类情况下仅适用于对于对象引用本身的更新。