[IMP] owl-core: add clear method on Resource and Registry - #2006
Merged
Conversation
`Resource` and `Registry` could only be emptied one entry at a time. Add a `clear` method on both, which removes everything at once. Each container is backed by a single signal, so `clear` replaces the underlying value: subscribers are notified once, and `items()`/`entries()` recompute. Entries added through `use()` are removed as well, and their scope cleanup becomes a no-op, so nothing reappears when the component or plugin is destroyed. `clear` returns `void` on both classes: there is nothing left to operate on, so chaining would be pointless. `Registry.delete` however was the only removal method that was not chainable, unlike `Resource.delete` and every other `Registry` method, so it now returns the registry as well.
ged-odoo
force-pushed
the
master-registry-clear-ged
branch
from
July 29, 2026 12:30
7def0f4 to
ff03afc
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
ResourceandRegistrycould only be emptied one entry at a time. This PR adds aclearmethod on both.Each container is backed by a single signal, so
clearreplaces the underlying value: subscribers are notified once anditems()/entries()recompute. Entries added throughuse()are removed as well — their scope cleanup is either guarded or a no-op filter, so nothing reappears when the component or plugin is destroyed.Resource.clearis chainable andRegistry.clearreturnsvoid, mirroringdeleteon each class.Also documented in the Resource / Registry reference pages (new sections + API summary rows).