Skip to content

Commit

Permalink
Pre-bind private selectors so that registry selectors are bound to re…
Browse files Browse the repository at this point in the history
…gistry
  • Loading branch information
jsnajdr committed Jun 7, 2023
1 parent ba0246b commit 3aa08c6
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions packages/data/src/redux-store/index.js
Original file line number Diff line number Diff line change
@@ -248,6 +248,13 @@ export default function createReduxStore( key, options ) {
}

const boundPrivateSelectors = createBindingCache( bindSelector );

// Pre-bind the private selectors that have been registered by the time of
// instantiation, so that registry selectors are bound to the registry.
for ( const privateSelector of Object.values( privateSelectors ) ) {
boundPrivateSelectors.get( privateSelector );
}

const allSelectors = new Proxy( () => {}, {
get: ( target, prop ) => {
const privateSelector = privateSelectors[ prop ];

0 comments on commit 3aa08c6

Please sign in to comment.