-
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
Allow passing optional afterLoad
callbacks to store
calls
#53363
Conversation
32c396e
to
9ca6552
Compare
@luisherranz ready for review ☝️ |
Size Change: +32 B (0%) Total Size: 1.44 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.
Looks good to me!
Thanks, @artemiomorales. I'll wait for @luisherranz to take a look as well before merging. 😊 |
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.
Codewise everything looks good. Great tests by the way 🙂
Would you mind adding a new section to the API reference to document the options argument and in there, the afterLoad
option? It doesn't have to be extensive, we can improve it later, but at least we should mention it. Thanks!!
Flaky tests detected in 58447c8. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/5822624113
|
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.
Cool. Thanks, David 🙂
What?
Allow developers to pass callbacks to the Interactivity API
store
function, e.g.,Why?
Some block types would need to initialize stuff in the global state, which might require the store to be ready.
How?
A
Set
instance stores all the passedafterLoad
callbacks to avoid duplicates. All registered callbacks run right after theinit()
function, receiving the global store.Testing Instructions
It includes e2e tests that should pass.