Skip to content

Commit 43f0bb0

Browse files
committed
only useReduxSelectors
1 parent bcfa52c commit 43f0bb0

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

__tests__/03_stale_props.js

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,18 @@ import { render, cleanup } from 'react-testing-library';
55

66
import {
77
ReduxProvider,
8-
useReduxState,
98
useReduxSelectors,
109
} from '../src/index';
1110

1211
describe('stale props spec', () => {
1312
afterEach(cleanup);
1413

1514
it('ignores transient errors in selector (e.g. due to stale props)', () => {
15+
const globalSelectors = {
16+
count: state => state.count,
17+
};
1618
const Parent = () => {
17-
const { count } = useReduxState();
19+
const { count } = useReduxSelectors(globalSelectors);
1820
return <Child parentCount={count} />;
1921
};
2022

@@ -46,8 +48,11 @@ describe('stale props spec', () => {
4648
it('ensures consistency of state and props in selector', () => {
4749
let selectorSawInconsistencies = false;
4850

51+
const globalSelectors = {
52+
count: state => state.count,
53+
};
4954
const Parent = () => {
50-
const { count } = useReduxState();
55+
const { count } = useReduxSelectors(globalSelectors);
5156
return <Child parentCount={count} />;
5257
};
5358

0 commit comments

Comments
 (0)