I am not familiar with the book and with the code, which you thought was difficult to say whether it is right or not. It comes down to what LoadTransientState
actually does.
The approach you want to take to handle the tomb is to make sure that (if that makes sense in the application *), the application / page should be in the same state when the user returns to it, as when they leave.
So, if the LoadTransientState
is only related to saving information during the tombstone, then it may be advisable to move it inside the if
block.
If we are talking about any other form of transient data, then probably not.
Hopefully LoadTransientState
will contain some logic to ensure that it does not install (or overwrite) data that already exists (or has been installed) internally and therefore avoids any expected consequences of the unnecessary use caused.
* Some obvious exceptions are real-time data, timers (possibly), real-time information, etc.
source share