From 40dd54d09f75a81f7eb6560bc900cff9751773d3 Mon Sep 17 00:00:00 2001 From: Justin Leider Date: Thu, 30 Dec 2021 11:26:10 -0500 Subject: [PATCH] Add readme for debug and bump version to 1.4.0 --- README.md | 8 ++++++++ package-lock.json | 2 +- package.json | 2 +- 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 8ad13bd..9f56c71 100644 --- a/README.md +++ b/README.md @@ -59,6 +59,14 @@ useStableEffect(() => { }, [data], Eq.getTupleEq(O.getEq(Eq.eqString))); ``` +## Debugging Your Hooks + +You can console log the reasons behind why certain hooks are called again by passing a debug flag to each one of the +stable hooks which have equality functions provided in the API. The last parameter of the function is now a config +object: `StableHookOptions`. + +You can pass `{debug: true}` to have the console logs printed in all environments except for `production`. + ## API | React Hook | Stable Hook | Description | diff --git a/package-lock.json b/package-lock.json index 951042d..67df818 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "fp-ts-react-stable-hooks", - "version": "1.1.0", + "version": "1.4.0", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 3aee63f..adf999c 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "fp-ts-react-stable-hooks", - "version": "1.3.0", + "version": "1.4.0", "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",