@superdispatch/hooks
Advanced tools
Comparing version 0.5.5 to 0.5.6
@@ -41,5 +41,2 @@ 'use strict'; | ||
console.error('[useDeepEqualDeps] size of the "deps" argument has changed between renders. ' + 'The order and size of this array must remain constant.'); | ||
} else if (initialDeps.length === 0) { | ||
// eslint-disable-next-line no-console | ||
console.error('[useDeepEqualDeps] "deps" argument should not be empty.'); | ||
} | ||
@@ -46,0 +43,0 @@ } // eslint-disable-next-line @typescript-eslint/no-unsafe-return |
@@ -13,5 +13,2 @@ import { useRef } from 'react'; | ||
console.error('[useDeepEqualDeps] size of the "deps" argument has changed between renders. ' + 'The order and size of this array must remain constant.'); | ||
} else if (initialDeps.length === 0) { | ||
// eslint-disable-next-line no-console | ||
console.error('[useDeepEqualDeps] "deps" argument should not be empty.'); | ||
} | ||
@@ -18,0 +15,0 @@ } // eslint-disable-next-line @typescript-eslint/no-unsafe-return |
@@ -42,13 +42,12 @@ import { renderHook } from '@testing-library/react-hooks'; | ||
initialProps: { | ||
deps: [] | ||
deps: [1, 2, 3] | ||
} | ||
}); | ||
expect(consoleError).toHaveBeenCalledTimes(1); | ||
expect(consoleError).toHaveBeenLastCalledWith('[useDeepEqualDeps] "deps" argument should not be empty.'); | ||
expect(consoleError).toHaveBeenCalledTimes(0); | ||
rerender({ | ||
deps: [1] | ||
deps: [1, 2, 3, 4] | ||
}); | ||
expect(consoleError).toHaveBeenCalledTimes(2); | ||
expect(consoleError).toHaveBeenCalledTimes(1); | ||
expect(consoleError).toHaveBeenLastCalledWith('[useDeepEqualDeps] size of the "deps" argument has changed between renders. The order and size of this array must remain constant.'); | ||
consoleError.mockReset(); | ||
}); |
@@ -37,5 +37,2 @@ import { useRef, useLayoutEffect, useMemo, useEffect, useCallback } from 'react'; | ||
console.error('[useDeepEqualDeps] size of the "deps" argument has changed between renders. ' + 'The order and size of this array must remain constant.'); | ||
} else if (initialDeps.length === 0) { | ||
// eslint-disable-next-line no-console | ||
console.error('[useDeepEqualDeps] "deps" argument should not be empty.'); | ||
} | ||
@@ -42,0 +39,0 @@ } // eslint-disable-next-line @typescript-eslint/no-unsafe-return |
{ | ||
"name": "@superdispatch/hooks", | ||
"version": "0.5.5", | ||
"version": "0.5.6", | ||
"license": "MIT", | ||
@@ -5,0 +5,0 @@ "files": [ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
31743
546