Skip to content

Commit

Permalink
WIP Clean up logging and enable all tests
Browse files Browse the repository at this point in the history
  • Loading branch information
markerikson committed Jun 26, 2023
1 parent 7f88124 commit d0147c8
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion src/hooks/useSelector.ts
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ export function createSelectorHook(context = ReactReduxContext): UseSelector {
latestWrappedSelectorRef.current = wrappedSelector

const cache = useMemo(() => {
console.log('Recreating cache')
//console.log('Recreating cache')
const cache = createCache(() => {
// console.log('Wrapper cache called: ', store.getState())
//return latestWrappedSelectorRef.current(trackingNode.proxy as TState)
Expand Down
18 changes: 9 additions & 9 deletions src/utils/Subscription.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,17 +47,17 @@ function createListenerCollection() {
if (listener.trigger == 'tracked') {
if (listener.selectorCache!.cache.needsRecalculation()) {
//console.log('Calling subscriber due to recalc need')
console.log(
'Calling subscriber due to recalc. Revision before: ',
$REVISION
)
// console.log(
// 'Calling subscriber due to recalc. Revision before: ',
// $REVISION
// )
listener.callback()
//console.log('Revision after: ', $REVISION)
} else {
console.log(
'Skipping subscriber, no recalc: ',
listener.selectorCache
)
// console.log(
// 'Skipping subscriber, no recalc: ',
// listener.selectorCache
// )
}
} else {
listener.callback()
Expand Down Expand Up @@ -169,7 +169,7 @@ export function createSubscription(

function notifyNestedSubs() {
if (store && trackingNode) {
console.log('Updating node in notifyNestedSubs')
//console.log('Updating node in notifyNestedSubs')
updateNode(trackingNode, store.getState())
}
listeners.notify()
Expand Down
2 changes: 1 addition & 1 deletion test/hooks/useSelector.spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -451,7 +451,7 @@ describe('React', () => {
expect(renderedItems.length).toEqual(2)
})

it.only('only re-runs selectors if the referenced fields actually change', () => {
it('only re-runs selectors if the referenced fields actually change', () => {
interface StateType {
count1: number
count2: number
Expand Down

0 comments on commit d0147c8

Please sign in to comment.