Skip to content

Commit

Permalink
✨ Refactor useResize and useEffect (#56)
Browse files Browse the repository at this point in the history
  • Loading branch information
prabhuignoto authored Aug 21, 2023
1 parent e53af58 commit 3d4e863
Show file tree
Hide file tree
Showing 37 changed files with 614 additions and 481 deletions.
94 changes: 53 additions & 41 deletions coverage/clover.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<coverage generated="1692337704677" clover="3.2.0">
<project timestamp="1692337704677" name="All files">
<metrics statements="817" coveredstatements="640" conditionals="81" coveredconditionals="73" methods="25" coveredmethods="14" elements="923" coveredelements="727" complexity="0" loc="817" ncloc="817" packages="6" files="22" classes="22"/>
<coverage generated="1692594572422" clover="3.2.0">
<project timestamp="1692594572422" name="All files">
<metrics statements="829" coveredstatements="660" conditionals="87" coveredconditionals="78" methods="25" coveredmethods="14" elements="941" coveredelements="752" complexity="0" loc="829" ncloc="829" packages="6" files="22" classes="22"/>
<package name="components.controls">
<metrics statements="64" coveredstatements="64" conditionals="13" coveredconditionals="12" methods="2" coveredmethods="2"/>
<file name="button.tsx" path="C:\Users\prabh\Github\react-visual-grid\src\components\controls\button.tsx">
Expand Down Expand Up @@ -686,9 +686,9 @@
</file>
</package>
<package name="effects">
<metrics statements="206" coveredstatements="195" conditionals="34" coveredconditionals="32" methods="3" coveredmethods="3"/>
<metrics statements="218" coveredstatements="215" conditionals="40" coveredconditionals="37" methods="3" coveredmethods="3"/>
<file name="useKey.ts" path="C:\Users\prabh\Github\react-visual-grid\src\effects\useKey.ts">
<metrics statements="44" coveredstatements="35" conditionals="5" coveredconditionals="5" methods="1" coveredmethods="1"/>
<metrics statements="56" coveredstatements="55" conditionals="11" coveredconditionals="10" methods="1" coveredmethods="1"/>
<line num="1" count="1" type="stmt"/>
<line num="2" count="1" type="stmt"/>
<line num="3" count="1" type="stmt"/>
Expand All @@ -697,42 +697,54 @@
<line num="6" count="1" type="stmt"/>
<line num="7" count="1" type="stmt"/>
<line num="8" count="1" type="stmt"/>
<line num="9" count="7" type="cond" truecount="1" falsecount="0"/>
<line num="10" count="7" type="stmt"/>
<line num="11" count="7" type="stmt"/>
<line num="12" count="7" type="stmt"/>
<line num="13" count="0" type="stmt"/>
<line num="14" count="0" type="stmt"/>
<line num="15" count="0" type="stmt"/>
<line num="16" count="0" type="stmt"/>
<line num="17" count="0" type="stmt"/>
<line num="18" count="0" type="stmt"/>
<line num="19" count="0" type="stmt"/>
<line num="20" count="0" type="stmt"/>
<line num="21" count="0" type="stmt"/>
<line num="22" count="7" type="stmt"/>
<line num="23" count="7" type="stmt"/>
<line num="24" count="7" type="cond" truecount="1" falsecount="0"/>
<line num="25" count="14" type="cond" truecount="1" falsecount="0"/>
<line num="26" count="7" type="stmt"/>
<line num="27" count="7" type="stmt"/>
<line num="28" count="7" type="stmt"/>
<line num="29" count="7" type="stmt"/>
<line num="30" count="7" type="stmt"/>
<line num="31" count="7" type="stmt"/>
<line num="32" count="7" type="cond" truecount="1" falsecount="0"/>
<line num="33" count="7" type="cond" truecount="1" falsecount="0"/>
<line num="34" count="7" type="stmt"/>
<line num="35" count="7" type="stmt"/>
<line num="36" count="7" type="stmt"/>
<line num="37" count="7" type="stmt"/>
<line num="38" count="7" type="stmt"/>
<line num="39" count="7" type="stmt"/>
<line num="40" count="7" type="stmt"/>
<line num="41" count="7" type="stmt"/>
<line num="42" count="7" type="stmt"/>
<line num="43" count="7" type="stmt"/>
<line num="44" count="7" type="stmt"/>
<line num="9" count="12" type="cond" truecount="1" falsecount="0"/>
<line num="10" count="12" type="stmt"/>
<line num="11" count="12" type="stmt"/>
<line num="12" count="12" type="stmt"/>
<line num="13" count="12" type="stmt"/>
<line num="14" count="12" type="cond" truecount="1" falsecount="0"/>
<line num="15" count="4" type="stmt"/>
<line num="16" count="4" type="cond" truecount="1" falsecount="0"/>
<line num="17" count="2" type="cond" truecount="1" falsecount="0"/>
<line num="18" count="2" type="stmt"/>
<line num="19" count="4" type="cond" truecount="1" falsecount="0"/>
<line num="20" count="1" type="stmt"/>
<line num="21" count="1" type="stmt"/>
<line num="22" count="4" type="cond" truecount="1" falsecount="0"/>
<line num="23" count="1" type="stmt"/>
<line num="24" count="1" type="stmt"/>
<line num="25" count="4" type="cond" truecount="0" falsecount="1"/>
<line num="26" count="0" type="stmt"/>
<line num="27" count="4" type="stmt"/>
<line num="28" count="4" type="stmt"/>
<line num="29" count="12" type="stmt"/>
<line num="30" count="12" type="stmt"/>
<line num="31" count="12" type="stmt"/>
<line num="32" count="12" type="stmt"/>
<line num="33" count="12" type="stmt"/>
<line num="34" count="12" type="cond" truecount="1" falsecount="0"/>
<line num="35" count="19" type="cond" truecount="1" falsecount="0"/>
<line num="36" count="12" type="stmt"/>
<line num="37" count="12" type="stmt"/>
<line num="38" count="12" type="stmt"/>
<line num="39" count="12" type="stmt"/>
<line num="40" count="19" type="stmt"/>
<line num="41" count="12" type="stmt"/>
<line num="42" count="12" type="stmt"/>
<line num="43" count="12" type="stmt"/>
<line num="44" count="12" type="stmt"/>
<line num="45" count="12" type="cond" truecount="1" falsecount="0"/>
<line num="46" count="12" type="cond" truecount="1" falsecount="0"/>
<line num="47" count="12" type="stmt"/>
<line num="48" count="12" type="stmt"/>
<line num="49" count="12" type="stmt"/>
<line num="50" count="12" type="stmt"/>
<line num="51" count="12" type="stmt"/>
<line num="52" count="12" type="stmt"/>
<line num="53" count="12" type="stmt"/>
<line num="54" count="12" type="stmt"/>
<line num="55" count="12" type="stmt"/>
<line num="56" count="12" type="stmt"/>
</file>
<file name="useStyle.ts" path="C:\Users\prabh\Github\react-visual-grid\src\effects\useStyle.ts">
<metrics statements="114" coveredstatements="112" conditionals="24" coveredconditionals="22" methods="1" coveredmethods="1"/>
Expand Down
94 changes: 53 additions & 41 deletions coverage/cobertura-coverage.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" ?>
<!DOCTYPE coverage SYSTEM "http://cobertura.sourceforge.net/xml/coverage-04.dtd">
<coverage lines-valid="817" lines-covered="640" line-rate="0.7833" branches-valid="81" branches-covered="73" branch-rate="0.9012" timestamp="1692337704697" complexity="0" version="0.1">
<coverage lines-valid="829" lines-covered="660" line-rate="0.7961" branches-valid="87" branches-covered="78" branch-rate="0.8965000000000001" timestamp="1692594572451" complexity="0" version="0.1">
<sources>
<source>C:/Users/prabh/Github/react-visual-grid</source>
</sources>
Expand Down Expand Up @@ -860,13 +860,13 @@
</class>
</classes>
</package>
<package name="effects" line-rate="0.9466" branch-rate="0.9411">
<package name="effects" line-rate="0.9862000000000001" branch-rate="0.925">
<classes>
<class name="useKey.ts" filename="src\effects\useKey.ts" line-rate="0.7954000000000001" branch-rate="1">
<class name="useKey.ts" filename="src\effects\useKey.ts" line-rate="0.9821" branch-rate="0.909">
<methods>
<method name="useKey" hits="7" signature="()V">
<method name="useKey" hits="12" signature="()V">
<lines>
<line number="9" hits="7"/>
<line number="9" hits="12"/>
</lines>
</method>
</methods>
Expand All @@ -879,42 +879,54 @@
<line number="6" hits="1" branch="false"/>
<line number="7" hits="1" branch="false"/>
<line number="8" hits="1" branch="false"/>
<line number="9" hits="7" branch="true" condition-coverage="100% (1/1)"/>
<line number="10" hits="7" branch="false"/>
<line number="11" hits="7" branch="false"/>
<line number="12" hits="7" branch="false"/>
<line number="13" hits="0" branch="false"/>
<line number="14" hits="0" branch="false"/>
<line number="15" hits="0" branch="false"/>
<line number="16" hits="0" branch="false"/>
<line number="17" hits="0" branch="false"/>
<line number="18" hits="0" branch="false"/>
<line number="19" hits="0" branch="false"/>
<line number="20" hits="0" branch="false"/>
<line number="21" hits="0" branch="false"/>
<line number="22" hits="7" branch="false"/>
<line number="23" hits="7" branch="false"/>
<line number="24" hits="7" branch="true" condition-coverage="100% (1/1)"/>
<line number="25" hits="14" branch="true" condition-coverage="100% (1/1)"/>
<line number="26" hits="7" branch="false"/>
<line number="27" hits="7" branch="false"/>
<line number="28" hits="7" branch="false"/>
<line number="29" hits="7" branch="false"/>
<line number="30" hits="7" branch="false"/>
<line number="31" hits="7" branch="false"/>
<line number="32" hits="7" branch="true" condition-coverage="100% (1/1)"/>
<line number="33" hits="7" branch="true" condition-coverage="100% (1/1)"/>
<line number="34" hits="7" branch="false"/>
<line number="35" hits="7" branch="false"/>
<line number="36" hits="7" branch="false"/>
<line number="37" hits="7" branch="false"/>
<line number="38" hits="7" branch="false"/>
<line number="39" hits="7" branch="false"/>
<line number="40" hits="7" branch="false"/>
<line number="41" hits="7" branch="false"/>
<line number="42" hits="7" branch="false"/>
<line number="43" hits="7" branch="false"/>
<line number="44" hits="7" branch="false"/>
<line number="9" hits="12" branch="true" condition-coverage="100% (1/1)"/>
<line number="10" hits="12" branch="false"/>
<line number="11" hits="12" branch="false"/>
<line number="12" hits="12" branch="false"/>
<line number="13" hits="12" branch="false"/>
<line number="14" hits="12" branch="true" condition-coverage="100% (1/1)"/>
<line number="15" hits="4" branch="false"/>
<line number="16" hits="4" branch="true" condition-coverage="100% (1/1)"/>
<line number="17" hits="2" branch="true" condition-coverage="100% (1/1)"/>
<line number="18" hits="2" branch="false"/>
<line number="19" hits="4" branch="true" condition-coverage="100% (1/1)"/>
<line number="20" hits="1" branch="false"/>
<line number="21" hits="1" branch="false"/>
<line number="22" hits="4" branch="true" condition-coverage="100% (1/1)"/>
<line number="23" hits="1" branch="false"/>
<line number="24" hits="1" branch="false"/>
<line number="25" hits="4" branch="true" condition-coverage="0% (0/1)"/>
<line number="26" hits="0" branch="false"/>
<line number="27" hits="4" branch="false"/>
<line number="28" hits="4" branch="false"/>
<line number="29" hits="12" branch="false"/>
<line number="30" hits="12" branch="false"/>
<line number="31" hits="12" branch="false"/>
<line number="32" hits="12" branch="false"/>
<line number="33" hits="12" branch="false"/>
<line number="34" hits="12" branch="true" condition-coverage="100% (1/1)"/>
<line number="35" hits="19" branch="true" condition-coverage="100% (1/1)"/>
<line number="36" hits="12" branch="false"/>
<line number="37" hits="12" branch="false"/>
<line number="38" hits="12" branch="false"/>
<line number="39" hits="12" branch="false"/>
<line number="40" hits="19" branch="false"/>
<line number="41" hits="12" branch="false"/>
<line number="42" hits="12" branch="false"/>
<line number="43" hits="12" branch="false"/>
<line number="44" hits="12" branch="false"/>
<line number="45" hits="12" branch="true" condition-coverage="100% (1/1)"/>
<line number="46" hits="12" branch="true" condition-coverage="100% (1/1)"/>
<line number="47" hits="12" branch="false"/>
<line number="48" hits="12" branch="false"/>
<line number="49" hits="12" branch="false"/>
<line number="50" hits="12" branch="false"/>
<line number="51" hits="12" branch="false"/>
<line number="52" hits="12" branch="false"/>
<line number="53" hits="12" branch="false"/>
<line number="54" hits="12" branch="false"/>
<line number="55" hits="12" branch="false"/>
<line number="56" hits="12" branch="false"/>
</lines>
</class>
<class name="useStyle.ts" filename="src\effects\useStyle.ts" line-rate="0.9823999999999999" branch-rate="0.9166">
Expand Down
2 changes: 1 addition & 1 deletion coverage/lcov-report/components/controls/button.tsx.html
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@ <h1><a href="../../index.html">All files</a> / <a href="index.html">components/c
<div class='footer quiet pad2 space-top1 center small'>
Code coverage generated by
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
at 2023-08-18T05:48:24.579Z
at 2023-08-21T05:09:32.317Z
</div>
<script src="../../prettify.js"></script>
<script>
Expand Down
2 changes: 1 addition & 1 deletion coverage/lcov-report/components/controls/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ <h1><a href="../../index.html">All files</a> components/controls</h1>
<div class='footer quiet pad2 space-top1 center small'>
Code coverage generated by
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
at 2023-08-18T05:48:24.579Z
at 2023-08-21T05:09:32.317Z
</div>
<script src="../../prettify.js"></script>
<script>
Expand Down
2 changes: 1 addition & 1 deletion coverage/lcov-report/components/icons/alert.tsx.html
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ <h1><a href="../../index.html">All files</a> / <a href="index.html">components/i
<div class='footer quiet pad2 space-top1 center small'>
Code coverage generated by
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
at 2023-08-18T05:48:24.579Z
at 2023-08-21T05:09:32.317Z
</div>
<script src="../../prettify.js"></script>
<script>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ <h1><a href="../../index.html">All files</a> / <a href="index.html">components/i
<div class='footer quiet pad2 space-top1 center small'>
Code coverage generated by
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
at 2023-08-18T05:48:24.579Z
at 2023-08-21T05:09:32.317Z
</div>
<script src="../../prettify.js"></script>
<script>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ <h1><a href="../../index.html">All files</a> / <a href="index.html">components/i
<div class='footer quiet pad2 space-top1 center small'>
Code coverage generated by
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
at 2023-08-18T05:48:24.579Z
at 2023-08-21T05:09:32.317Z
</div>
<script src="../../prettify.js"></script>
<script>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ <h1><a href="../../index.html">All files</a> / <a href="index.html">components/i
<div class='footer quiet pad2 space-top1 center small'>
Code coverage generated by
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
at 2023-08-18T05:48:24.579Z
at 2023-08-21T05:09:32.317Z
</div>
<script src="../../prettify.js"></script>
<script>
Expand Down
2 changes: 1 addition & 1 deletion coverage/lcov-report/components/icons/chevron-up.tsx.html
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ <h1><a href="../../index.html">All files</a> / <a href="index.html">components/i
<div class='footer quiet pad2 space-top1 center small'>
Code coverage generated by
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
at 2023-08-18T05:48:24.579Z
at 2023-08-21T05:09:32.317Z
</div>
<script src="../../prettify.js"></script>
<script>
Expand Down
2 changes: 1 addition & 1 deletion coverage/lcov-report/components/icons/close.tsx.html
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ <h1><a href="../../index.html">All files</a> / <a href="index.html">components/i
<div class='footer quiet pad2 space-top1 center small'>
Code coverage generated by
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
at 2023-08-18T05:48:24.579Z
at 2023-08-21T05:09:32.317Z
</div>
<script src="../../prettify.js"></script>
<script>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ <h1><a href="../../index.html">All files</a> / <a href="index.html">components/i
<div class='footer quiet pad2 space-top1 center small'>
Code coverage generated by
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
at 2023-08-18T05:48:24.579Z
at 2023-08-21T05:09:32.317Z
</div>
<script src="../../prettify.js"></script>
<script>
Expand Down
2 changes: 1 addition & 1 deletion coverage/lcov-report/components/icons/full-screen.tsx.html
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ <h1><a href="../../index.html">All files</a> / <a href="index.html">components/i
<div class='footer quiet pad2 space-top1 center small'>
Code coverage generated by
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
at 2023-08-18T05:48:24.579Z
at 2023-08-21T05:09:32.317Z
</div>
<script src="../../prettify.js"></script>
<script>
Expand Down
2 changes: 1 addition & 1 deletion coverage/lcov-report/components/icons/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,7 @@ <h1><a href="../../index.html">All files</a> components/icons</h1>
<div class='footer quiet pad2 space-top1 center small'>
Code coverage generated by
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
at 2023-08-18T05:48:24.579Z
at 2023-08-21T05:09:32.317Z
</div>
<script src="../../prettify.js"></script>
<script>
Expand Down
2 changes: 1 addition & 1 deletion coverage/lcov-report/components/icons/index.ts.html
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ <h1><a href="../../index.html">All files</a> / <a href="index.html">components/i
<div class='footer quiet pad2 space-top1 center small'>
Code coverage generated by
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
at 2023-08-18T05:48:24.579Z
at 2023-08-21T05:09:32.317Z
</div>
<script src="../../prettify.js"></script>
<script>
Expand Down
2 changes: 1 addition & 1 deletion coverage/lcov-report/components/icons/maximize.tsx.html
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ <h1><a href="../../index.html">All files</a> / <a href="index.html">components/i
<div class='footer quiet pad2 space-top1 center small'>
Code coverage generated by
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
at 2023-08-18T05:48:24.579Z
at 2023-08-21T05:09:32.317Z
</div>
<script src="../../prettify.js"></script>
<script>
Expand Down
Loading

1 comment on commit 3d4e863

@vercel
Copy link

@vercel vercel bot commented on 3d4e863 Aug 21, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.