Dynamic reconfiguration, known facets

In the configuration examples, after it talks about use of compartments, there’s this interesting statement:

If you just need to dynamically change the value of some known facet, it is preferable to use computed facets instead of reconfiguration, since those are more efficient and easier to keep track of (they are a form of derived state, rather than adding new fundamental state).

This is after it’s gone into discussing changing the tab size, which is, to my understanding, a ‘known facet’, via a compartment.

I find this statement intriguing, especially the ‘easier’ and ‘more efficient’ bits that it’s dangling in front of me, as there are a number of known facets that I’d like to reconfigure from time to time, but I can’t seem to find any further discussion or example that’d pertain to the statement, and I’m curious if I’m missing something obvious.

If you can use a computed facet (if your value is derived from other information present in the state), use one. But “I’d like to reconfigure from time to time” doesn’t sound like that applies in your situation.

To clarify, it’s the ‘discussion or example’ of using a computed facet for this use case that I’m looking for. For example, toggling the readOnly or editable states is a common use case for me, and at present I’m handling that using Compartments. If indeed using a computed facet for these is easier and more efficient, then an example of doing so would be welcomed.

There’s a link to the docs for Facet.compute right there. You can figure it out, I’m sure.