Skip to content

Commit

Permalink
Merge pull request #4 from mblink/ht-fix-debug-logs
Browse files Browse the repository at this point in the history
Fix console logs
  • Loading branch information
jleider authored Dec 30, 2021
2 parents 40dd54d + f0a55d0 commit 47f0273
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "fp-ts-react-stable-hooks",
"version": "1.4.0",
"version": "1.4.1",
"description": "Stable hooks for react using FP-TS equality checks instead of shallow (reference) object comparison",
"main": "dist/lib/index.js",
"module": "dist/es2015/index.js",
Expand Down
8 changes: 3 additions & 5 deletions src/useEqMemoize.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,9 @@ export const useEqMemoize = <A extends ReadonlyArray<unknown>>(

if (!eq.equals(value, ref.current)) {
// https://stackoverflow.com/questions/35469836/detecting-production-vs-development-react-at-runtime
if(options && options.debug && process.env.NODE_ENV !== 'production') {
/* eslint-disable no-console */
console.info('Stable hook update triggered:');
console.table({ 'prev': ref.current, 'value': value });
/* eslint-enable no-console */
if (options && options.debug && process.env.NODE_ENV !== 'production') {
// eslint-disable-next-line no-console
console.info('Stable hook update triggered:', { 'prev': ref.current, 'value': value });
}
ref.current = value;
signalRef.current += 1;
Expand Down

0 comments on commit 47f0273

Please sign in to comment.