-
-
Notifications
You must be signed in to change notification settings - Fork 4.1k
add filtering for Vuex state #418
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
Conversation
'inspectedState' | ||
]), | ||
filteredState() { | ||
const filtered = {}; |
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.
What do you think about reusing what is in ComponentStateInspector? So we just need to build the array of properties before filtering them:
const inspectedState = [].concat(
...Object.keys(this.inspectedState).map(
type => Object.keys(this.inspectedState[type]).map(
key => ({
key,
type,
value: this.inspectedState[type][key]
})
)
)
)
return groupBy(sortByKey(inspectedState.filter(el => {
return searchDeepInObject({
[el.key]: el.value
}, this.filter)
})), 'type')
It would probably be nice to refactor the last part in the future so it's reused
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.
Good idea, I'll do it first thing when I have some spare time.
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.
Don't worry, I can add it myself as well. Thanks a lot for taking the time to contribute to the devtools! 😄
@posva I've actually used your snippet - works perfectly |
@posva have you tried this locally? |
@yyx990803 Not yet, let me give it a shot |
Tested and works nicely, ofc, it would be better with a test 😄 , I'll add it |
hhm, got some tests failing. I see we haven't turned on ci on prs but I cannot see the project on circle ci either 😅 |
Tested and working fine 👍 |
Thanks for picking up @Akryum ! |
Another simple PR that is really helpful, being able to filter out Vuex state. Closes #401