Skip to content

Add more events to lifecycle#6

Open
hituro wants to merge 1 commit intomcdemarco:masterfrom
hituro:master
Open

Add more events to lifecycle#6
hituro wants to merge 1 commit intomcdemarco:masterfrom
hituro:master

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