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

Triggering the bookend through the store. #14036

Merged
merged 4 commits into from Mar 16, 2018

Conversation

gmajoulet
Copy link
Contributor

The bookend is now triggered by this.storeService_.dispatch(Action.TOGGLE_BOOKEND, boolean), and the code updating the UI reacts to the store mutations. We no longer have to propagate the bookend events across all the components.
This will allow us to move all the bookend code into its own self contained component, which will be done in the next PR.

Copy link
Contributor

@newmuis newmuis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice!

if (pageId === null) {
dispatch(this.element, EventType.SHOW_BOOKEND, /* opt_bubbles */ true);
return;
if (pageId) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: slightly prefer

if (!pageId) {
  return;
}

this.switchTo_(pageId);

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

@newmuis newmuis merged commit ecc62dd into ampproject:master Mar 16, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants