source: node_modules/react-redux/src/connect/verifySubselectors.ts@ a762898

Last change on this file since a762898 was a762898, checked in by istevanoska <ilinastevanoska@…>, 5 months ago

Added visualizations

  • Property mode set to 100644
File size: 777 bytes
Line 
1import warning from '../utils/warning'
2
3function verify(selector: unknown, methodName: string): void {
4 if (!selector) {
5 throw new Error(`Unexpected value for ${methodName} in connect.`)
6 } else if (
7 methodName === 'mapStateToProps' ||
8 methodName === 'mapDispatchToProps'
9 ) {
10 if (!Object.prototype.hasOwnProperty.call(selector, 'dependsOnOwnProps')) {
11 warning(
12 `The selector for ${methodName} of connect did not specify a value for dependsOnOwnProps.`,
13 )
14 }
15 }
16}
17
18export default function verifySubselectors(
19 mapStateToProps: unknown,
20 mapDispatchToProps: unknown,
21 mergeProps: unknown,
22): void {
23 verify(mapStateToProps, 'mapStateToProps')
24 verify(mapDispatchToProps, 'mapDispatchToProps')
25 verify(mergeProps, 'mergeProps')
26}
Note: See TracBrowser for help on using the repository browser.