Skip to content

releaseAll({ keep }) — bulk release with an exemption list #3

Description

@firejune

Depends on #1. Screen-level teardown wants "release everything this screen assembled — except the entries that must survive".

Concrete consumer case: a settings screen assembles 11 sprite-sheet variants for a theme gallery; on close, only the currently active theme's sheet may stay alive (and "active" can have just changed inside that very gallery, so the exemption must be computed at call time, not snapshotted at open).

If consumers keep their own list of assembled paths in order to release them one by one, that list becomes a second source of truth for what the cache holds. The cache owner should accept the exemption list instead.

Proposal:

releaseAll(options?: { keep?: string[] }): void

keep entries are normalized with the same toMapKey rules as ensure()/release().

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions