-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Site Editor: Replace core/edit-site store name with store object #28695
Conversation
Size Change: +1.21 kB (0%) Total Size: 1.37 MB
ℹ️ View Unchanged
|
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 left some comments, I think they should be addressed to fix the errors on the build.
Besides, LGTM 😸
@@ -12,15 +12,24 @@ import * as actions from './actions'; | |||
import * as selectors from './selectors'; | |||
import { STORE_NAME } from './constants'; | |||
|
|||
export let store = null; | |||
|
|||
export default function registerEditSiteStore( initialState ) { |
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.
It's out of the scope of this PR, but the way this store is initialized is a bit concerning. It could be null
, but I guess it was also the case before. I'm curious why the initial state has to be set explicitly rather than dispatched with an action.
registerEditSiteStore
calls wouldn't be necessary in the tests otherwise.
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 don't know the reason for that either 🤔 I'll ask around and experiment so we can create a follow-up PR to clean it up.
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.
LGTM, with some remarks left.
Thank you for this refactoring 💯 |
Description
Related to #27088
Replaces hardcoded strings with the store object.
Store object wasn't exposed before due to the nature of how it's initialized. The current solution feels a bit hacky so looking forward to suggestions.
How has this been tested?
Types of changes
Code Quality
Checklist: