Here are some of the tips and trick I have learned when writing reactive charms. I have attached a simple bash example that helps illustrate the points in this email.
@hook decorators:
You almost never need @hook if you structure the reactive states correctly. I always have an "entry point" or a function that is called when no states are set (install_db2 in this example), and the function always sets the state when completing successfully. This function could be equivalent to the install hook, but is much better because removing the "[name].installed" state will cause the software to install again on the next reactive event cycle, where the install hook is only called on deploy and upgrade.
Immutability:
I normally have an "final state" that is always set when everything is complete. The reactive framework evaluates all the when and when_not decorators each time the states change, or a hook is run. So my "final state" function acts as a config-changed hook because the code will be run every time the react