From 3bb4c1571c7a6cc2c0f4e98cd476ba32096cff76 Mon Sep 17 00:00:00 2001 From: alex Date: Tue, 13 Feb 2018 09:43:02 +0000 Subject: [PATCH] Fix docs for `popState` (#626) Resolves https://github.com/choojs/choo/issues/621 --- README.md | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 3771df8..3c0e27c 100644 --- a/README.md +++ b/README.md @@ -208,10 +208,13 @@ and `'render'`. Similar to [history.replaceState](http://devdocs.io/dom/history#history-replacestate). ### `'popState'`|`state.events.POPSTATE` -This event should be emitted to navigate to a previous route. The new route -will be a previous entry in the browser's history stack, and will emit -`'navigate'` and `'render'`. Similar to -[history.popState](http://devdocs.io/dom_events/popstate). +This event is emitted when the user hits the 'back' button in their browser. +The new route will be a previous entry in the browser's history stack, and +immediately afterward the`'navigate'` and `'render'`events will be emitted. +Similar to [history.popState](http://devdocs.io/dom_events/popstate). (Note +that `emit('popState')` will _not_ cause a popState action - use +`history.go(-1)` for that - this is different to the behaviour of `pushState` +and `replaceState`!) ### `'DOMTitleChange'`|`state.events.DOMTITLECHANGE` This event should be emitted whenever the `document.title` needs to be updated.