Effect on store of multiple blocks in same plugin #65006
Closed
AlphaZebra
started this conversation in
Interactivity API
Replies: 1 comment 4 replies
-
Will you share some code examples? That would help with debugging and understanding the issue. |
Beta Was this translation helpful? Give feedback.
4 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I am almost certainly missing something obvious, but I'm currently encountering a problem when I take two blocks that I implemented in separate plugins and put them both in a single plugin. In one block, I read a system value (in this case, username) and place it in the store. In the other block, I prefill a form field by placing the field inside a div that has the attribute data-wp-watch="callbacks.prefill". The prefill callback finds the form field by id, then sets the value of the field by accessing the username in the store.
This works as advertised when the two blocks are in separate plugins, but it appears that the callback doesn't happen when both blocks are in the same plugin. I'm not asking a specific code fix question here, but rather wondering if there's anything about the store (including obvious things that I'm too big a dolt to have understood) that would account for this.
Thanks for increasing my store (he he) of store knowledge...
Beta Was this translation helpful? Give feedback.
All reactions