Skip to content

Commit

Permalink
Adds warning about invalid computed property access
Browse files Browse the repository at this point in the history
  • Loading branch information
ctrlplusb committed Aug 19, 2019
1 parent ee424b4 commit 6992dc9
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/create-store-internals.js
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,16 @@ export default function createStoreInternals({
} else if (references.getState == null) {
return undefined;
} else {
storeState = references.getState();
try {
storeState = references.getState();
} catch (err) {
if (process.env.NODE_ENV !== 'production') {
console.warn(
'Invalid access attempt to a computed property',
);
}
return undefined;
}
}
const state = get(parentPath, storeState);
const inputs = computedMeta.stateResolvers.map(resolver =>
Expand Down

0 comments on commit 6992dc9

Please sign in to comment.