Skip to content
This repository has been archived by the owner on Apr 5, 2022. It is now read-only.

Change how start() works #21

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

mrkishi
Copy link
Collaborator

@mrkishi mrkishi commented Jan 28, 2018

These commits change start() a bit:

  • Only start listening for events after start was called. This should help users not to forget to call it (eg. First dispatch flagged as isInitial, even if roadtrip.start() wasn't called #10), as leaving it out will cause some subtle bugs (eg. missing the first route's scroll position).

  • Add a dispatch option, which doesn't dispatch the current routes' handlers.

    Related to the previous point. Useful for SSRed apps. Alternative for checking isInitial on every route. On the name: I just saw it used on a few libraries before.

  • Set scrollRestoration to manual by default.

ps. Sorry for the dump! All these PRs are obviously debatable; just let me know if anything doesn't work for you. Hopefully we can get at least #20 merged, since we can't handle even SSRed 404s right now.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant