Skip to content

Instantly share code, notes, and snippets.

@gilbox
Created February 5, 2015 02:24
Show Gist options
  • Save gilbox/6ca6d850fe7bc9199cfe to your computer and use it in GitHub Desktop.
Save gilbox/6ca6d850fe7bc9199cfe to your computer and use it in GitHub Desktop.
function handlePathChange() {
actionCreator.handlePathChange({newPath:location.pathname + location.search});
}
// setup event listener for back/forward buttons
var eventInfo = window.addEventListener ? ['addEventListener', ''] : ['attachEvent', 'on'];
window[eventInfo[0]](eventInfo[1] + 'popstate', handlePathChange, false);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment