We can rename priorState to previousInstallState. Also, it should be declared as a static variable to be able to retain previousState value when the control goes out of the function.
We can rename priorState to previousInstallState.
Also, it should be declared as a static variable to be able to retain previousState value when the control goes out of the function.