An implementation based on browser storage event to persist items in local storage and session storage