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

Hint paths #18470

Merged
merged 3 commits into from
Oct 19, 2017
Merged

Hint paths #18470

merged 3 commits into from
Oct 19, 2017

Conversation

joshlory
Copy link
Contributor

Sample usage:

image

hint-path

)}
{!this.props.collapsed && this.props.hints && this.props.hints.map((hint) => {
if (hint.hintPath) {
window.dispatchEvent(new CustomEvent('displayHintPath', {detail: hint.hintPath}));
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm really not a fan of a map operation having a side effect. Can the craft app not subscribe to the redux store directly?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The problem is that Redux really wants you to subscribe via connect. See: reduxjs/redux#580 (comment).

I can do store.subscribe() to get notified on every single Redux action, then look at store.getState().authoredHints.seenHints to see if a hint is visible that doesn't match a cached list. Do you prefer that approach?

@joshlory
Copy link
Contributor Author

@Hamms PTAL!

Copy link
Contributor

@Hamms Hamms left a comment

Choose a reason for hiding this comment

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

Very nice!

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