-
Notifications
You must be signed in to change notification settings - Fork 484
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
Hint paths #18470
Conversation
)} | ||
{!this.props.collapsed && this.props.hints && this.props.hints.map((hint) => { | ||
if (hint.hintPath) { | ||
window.dispatchEvent(new CustomEvent('displayHintPath', {detail: hint.hintPath})); |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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?
@Hamms PTAL! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very nice!
Sample usage: