window.addEventListener('storage', () => { // When local storage changes, dump the list to // the console. console.log(JSON.parse(window.localStorage.getItem('sampleList'))); });