You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In some situations, you want to build controls that target another store from the registry. Until now we were relying on the global select or dispatch functions but the issue is that it only targets the default registry. If we have a separate provider, this might not work as expected. In this PR, I'm introducing a createRegistryControl helper used to mark a control a cross-stores control with access to the registry object.
constcontrols={TYPE_OF_CONTROL: createRegistryControl(registry=>(args)=>{// Do something with registry})}
This PR also includes a follow-up performance improvement to the registry-aware selectors.
This all seems sensible to me, but I've got some burrowed worry about how this actually works, when we'd have some separate RegistryProvider. I guess it might rely on some registry clone behavior like considered in #7453, which would re-assign the registry for the selectors / controls in the process of undergoing the clone?
@aduth That's a good point, I thought about it and yes it's challenging if we map the selectors and controls inside the store creation funciton. It means the clone function needs to reassign the selectors/controls somehow while if done at the registry level It would be generic, easily clonable but at the same time a little bit less performant.
I think this should be reconsidered as part of the "clone" implementation and whether the performance gain in long posts is important enough to be worth the added complexity.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FrameworkIssues related to broader framework topics, especially as it relates to javascript[Package] Data/packages/data
3 participants
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Related #13662 Requirement for #13088
In some situations, you want to build controls that target another store from the registry. Until now we were relying on the global
selectordispatchfunctions but the issue is that it only targets the default registry. If we have a separate provider, this might not work as expected. In this PR, I'm introducing acreateRegistryControlhelper used to mark a control a cross-stores control with access to the registry object.This PR also includes a follow-up performance improvement to the registry-aware selectors.