To your point https://git.vaughnnugent.com/cgit/vnuge/plugins-essentials.git/tree/lib/vnlib.browser/src/default/session/index.ts#n289
Usually I would gate this functionality behind a branch to avoid reassigning a variable. It's very rare for me to use a mutable variable except in a very controlled scope. In some parts of this library I've wrapped with getters and setters.