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

Force re-render event #3515

Merged
merged 5 commits into from
May 1, 2018
Merged

Force re-render event #3515

merged 5 commits into from
May 1, 2018

Conversation

Hypnosphi
Copy link
Member

Issue: #1736 introduced an ability to force rerender story, but you have to depend on a particular framework to use it. I've introduced a 'forceReRender' event that addons could use in a framework-agnostic way.

This also introduces constants for core events as a separate package (to avoid circular dependency between core and ui)

@Hypnosphi Hypnosphi mentioned this pull request Apr 30, 2018
5 tasks
@Hypnosphi Hypnosphi changed the title Force re render event Force re-render event Apr 30, 2018
Copy link
Member

@tmeasday tmeasday left a comment

Choose a reason for hiding this comment

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

Looks great, one minor tweak if you liek

@@ -170,6 +171,10 @@ export default function start(render, { decorateStory } = {}) {

renderUI();
reduxStore.subscribe(renderUI);
const forceReRender = () => renderUI(true);
if (isBrowser) {
channel.on(Events.FORCE_RE_RENDER, () => renderUI(true));
Copy link
Member

Choose a reason for hiding this comment

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

Use the forceRerender const here?

Copy link
Member Author

Choose a reason for hiding this comment

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

Sure, forgot that

@Hypnosphi Hypnosphi merged commit df21fed into master May 1, 2018
@Hypnosphi Hypnosphi deleted the force-re-render-event branch May 1, 2018 17:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants