-
Notifications
You must be signed in to change notification settings - Fork 13.6k
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
Added cache prop to ResultSet #1552
Added cache prop to ResultSet #1552
Conversation
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.
As mentioned in the issue, the caching should target results.data
instead of all of results
@@ -125,7 +127,8 @@ class ResultSet extends React.PureComponent { | |||
} | |||
render() { | |||
const query = this.props.query; | |||
const results = (this.props.query.cached) ? this.state.results : query.results; | |||
const results = | |||
(this.props.cache && this.props.query.cached) ? this.state.results : query.results; |
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.
nit this.props.query.cached
-> query.cached
I think if we don't want user to lose query data after refreshing, we could just keep results in global state for queries run in editor, and store results locally only for data preview? @mistercrunch |
Updated ResultSet to only cache results.data @mistercrunch |
LGTM! |
Bug/Issue:
Done:
needs-review @mistercrunch