If the value inside a StoredValue implements the drop trait, and that drop causes another read, update or dispose on another StoredValue, we'd get a cryptic panic with already mutably borrowed: BorrowError.
I encountered this issue with a StoredValue<Disposer> with the disposer type returned by as_child_of_current_owner(). Because the Disposer cleans up a reactive sub-scope on Drop, it will try to mutably borrow Runtime::stored_values while it is still mutably borrowed by the function that drops it.
If the value inside a
StoredValue
implements the drop trait, and that drop causes another read, update or dispose on another StoredValue, we'd get a cryptic panic withalready mutably borrowed: BorrowError
. I encountered this issue with aStoredValue<Disposer>
with the disposer type returned byas_child_of_current_owner()
. Because the Disposer cleans up a reactive sub-scope on Drop, it will try to mutably borrowRuntime::stored_values
while it is still mutably borrowed by the function that drops it.