Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add more events to lifecycle #6

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

hituro
Copy link

@hituro hituro commented Jan 31, 2023

Please ignore the deletion of the package-lock, and the addition of .gitignore ... these are because the original repo only had a .hgignore (which my git ignored)

The change to story.js adds two more lifecycle events.

  • startstory:after — fired at the very end of the start, when the new passage has been displayed
  • showpassage:ready — fired when a passage is added to history, but has not yet been processed

The purpose of these events is to enable you to save the state exactly as it was when the last passage transition happened (before that passage modifies state), and to be able to restore that state on refresh, if you wish.

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

Successfully merging this pull request may close these issues.

2 participants