Add selector for getting section root clientId#65001
Conversation
|
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message. To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
|
Size Change: +434 B (+0.02%) Total Size: 1.78 MB
ℹ️ View Unchanged
|
|
I'll rebase this so we can normalize towards a single selector. |
0482bee to
1392caf
Compare
| getDraggedBlockClientIds, | ||
| getBlockType, | ||
| getSectionRootClientId, | ||
| isZoomOutMode, |
There was a problem hiding this comment.
This isZoomOutMode dep isn't new, just the getSectionRootClientId above.
talldan
left a comment
There was a problem hiding this comment.
Nice change, this saves from having to pass the key around everywhere.
Tests well for me and code looks good. 👍
scruffian
left a comment
There was a problem hiding this comment.
This is much neater, thanks!
| export function getSectionRootClientId( state ) { | ||
| return state.settings?.[ sectionRootClientIdKey ]; | ||
| } |
There was a problem hiding this comment.
Having a JSDoc block could be helpful in the future.
There was a problem hiding this comment.
Yeh we really need to do that.
What?
Normalizes access to
sectionRootClientIdto a single private selector.Why?
Designed as a "code quality" fix. We have two options for improving the privacy of this property:
No matter which option we go with we'll want to normalize access to a single selector. This PR does that.
This PR is designed to be merged after one of the above PRs has been merged.
How?
Creates a single private selector to access the
sectionRootClientId.Testing Instructions
Same as #65000. Basically "does Zoom Out mode still work" as per
trunk?Testing Instructions for Keyboard
Screenshots or screencast