Looking Good Tips About How To Detect Browser Refresh

Window.onbeforeunload = function (evt) { var message = 'are you sure you want to leave?';
How to detect browser refresh. If (typeof evt == 'undefined') { evt =. @* // script for detect browser refresh. When the user refreshes the page it reset the context or redux state and you have to set them manually again.