This issue was moved to a discussion.
You can continue the conversation there. Go to discussion →
underive
does not delete the derived property unless there is a dependency defined
#685
Labels
help wanted
Extra attention is needed
Summary
Calling
underive
withdelete: true
does not delete the derived property value unless there is a dependency.derive
subscribes to the dependencies defined within thederive
function.underive
withdelete: true
loops through all of the dependencies.Set
to delete later.proxyObject
.The problem arises from a situation where the derived function never calls
get
(for whatever reason) which prevents a subscription from being created. The lack of a subscription prevents the property from being deleted which then prevents new calls toderive
because the property is already defined.Is this silly? Yes.
Was this hard to debug. Also yes. 😄
Property deletion should probably be decoupled from the existence of a subscription, especially since I see some async subscriptions being handled in the
derive
code which could possibly introduce a situation whereunderive
is called before the async value resolves which would result in a similar error.Link to reproduction
Pardon the lack of a codesandbox repro as the problem seemed pretty straight forward. I can make one if you really need one though.
Check List
Please do not ask questions in issues.
I've already opened a discussion before opening this issue, or already discussed in other media.Please include a minimal reproduction.
I've added a link to a typescript playground or codesandbox with a minimal reproduction.The text was updated successfully, but these errors were encountered: