Skip to content

Commit d0147c8

Browse files
committed
WIP Clean up logging and enable all tests
1 parent 7f88124 commit d0147c8

File tree

3 files changed

+11
-11
lines changed

3 files changed

+11
-11
lines changed

src/hooks/useSelector.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ export function createSelectorHook(context = ReactReduxContext): UseSelector {
149149
latestWrappedSelectorRef.current = wrappedSelector
150150

151151
const cache = useMemo(() => {
152-
console.log('Recreating cache')
152+
//console.log('Recreating cache')
153153
const cache = createCache(() => {
154154
// console.log('Wrapper cache called: ', store.getState())
155155
//return latestWrappedSelectorRef.current(trackingNode.proxy as TState)

src/utils/Subscription.ts

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -47,17 +47,17 @@ function createListenerCollection() {
4747
if (listener.trigger == 'tracked') {
4848
if (listener.selectorCache!.cache.needsRecalculation()) {
4949
//console.log('Calling subscriber due to recalc need')
50-
console.log(
51-
'Calling subscriber due to recalc. Revision before: ',
52-
$REVISION
53-
)
50+
// console.log(
51+
// 'Calling subscriber due to recalc. Revision before: ',
52+
// $REVISION
53+
// )
5454
listener.callback()
5555
//console.log('Revision after: ', $REVISION)
5656
} else {
57-
console.log(
58-
'Skipping subscriber, no recalc: ',
59-
listener.selectorCache
60-
)
57+
// console.log(
58+
// 'Skipping subscriber, no recalc: ',
59+
// listener.selectorCache
60+
// )
6161
}
6262
} else {
6363
listener.callback()
@@ -169,7 +169,7 @@ export function createSubscription(
169169

170170
function notifyNestedSubs() {
171171
if (store && trackingNode) {
172-
console.log('Updating node in notifyNestedSubs')
172+
//console.log('Updating node in notifyNestedSubs')
173173
updateNode(trackingNode, store.getState())
174174
}
175175
listeners.notify()

test/hooks/useSelector.spec.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -451,7 +451,7 @@ describe('React', () => {
451451
expect(renderedItems.length).toEqual(2)
452452
})
453453

454-
it.only('only re-runs selectors if the referenced fields actually change', () => {
454+
it('only re-runs selectors if the referenced fields actually change', () => {
455455
interface StateType {
456456
count1: number
457457
count2: number

0 commit comments

Comments
 (0)