Skip to content

Commit

Permalink
Add appHistory.transition with first-class rollback
Browse files Browse the repository at this point in the history
This gives insight into any "ongoing" navigation, i.e. a navigation that hasn't yet reached navigationsuccess/navigationerror because the promise passed to respondWith() has not yet settled.

Additionally:

* Removes the finished property from every AppHistoryEntry, which is nice because it only ever really made sense on the current entry; it was about the transition. Instead, the presence or nullness of appHistory.transition can be used.

* Adds a type property to AppHistoryNavigateEvent since we're going to have it on appHistory.transition anyway so having it earlier (before respondWith() is called) seems very reasonable.

Closes #86. Closes #11 by adding the appHistory.transition.finished promise.

Helps with #41 as you can retrieve data from the replaced entry, at least during the transition, with appHistory.transition.from.

Probably helps with #14 (although currentchange needs a bit of an overhaul) since appHistory.transition has the sort of useful information discussed there, such as the previous entry or the type of navigation.
  • Loading branch information
domenic authored Apr 5, 2021
1 parent d13d48b commit 8342f7d
Show file tree
Hide file tree
Showing 2 changed files with 117 additions and 73 deletions.
Loading

0 comments on commit 8342f7d

Please sign in to comment.