Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test(xy): scale type improvements #1381

Merged
merged 30 commits into from
Sep 16, 2021
Merged
Changes from 1 commit
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
543c33c
chore: tick values are numbers
monfera Sep 16, 2021
915c86f
chore: showing any via the generic type
monfera Sep 16, 2021
9ed546a
chore: converting more any to unknown
monfera Sep 16, 2021
12ef5a8
chore: converting more any to unknown 02
monfera Sep 16, 2021
c7f89b2
chore: converting more any to unknown 03
monfera Sep 16, 2021
26d9935
chore: converting more any to unknown 04
monfera Sep 16, 2021
8675664
chore: converting more any to unknown 05
monfera Sep 16, 2021
2ae39b3
chore: converting more any to real type 06
monfera Sep 16, 2021
57c5c8f
chore: converting more any to real type 07
monfera Sep 16, 2021
3607f0a
chore: converting more any to real type 08
monfera Sep 16, 2021
ae17f5c
chore: converting more any to real type 09
monfera Sep 16, 2021
bb93b5a
chore: converting more any to real type 10
monfera Sep 16, 2021
432238d
chore: converting more any to real type 11
monfera Sep 16, 2021
9be0b6a
chore: converting more any to real type 12
monfera Sep 16, 2021
770f3a6
chore: generic ScaleBand 01
monfera Sep 16, 2021
44af026
chore: generic ScaleBand 02
monfera Sep 16, 2021
6eea0f7
chore: generic ScaleBand 03
monfera Sep 16, 2021
0ec33ef
chore: converting more any to real type 13
monfera Sep 16, 2021
7272653
chore: converting more any to real type 14
monfera Sep 16, 2021
5bc5c0a
chore: converting more any to real type 15
monfera Sep 16, 2021
3e30380
chore: converting more any to real type 16
monfera Sep 16, 2021
09bed4a
refactor: drive by removal of verbose code
monfera Sep 16, 2021
c20cef9
chore: converting more any to real type 17
monfera Sep 16, 2021
0ac3fd2
test: type improvement round ht MarcoV NickP
monfera Sep 16, 2021
8cd6cda
test: generic typing for isBandScale
monfera Sep 16, 2021
afaceb6
test: doing away with the unknown
monfera Sep 16, 2021
b59e2e0
test: more assertion removals due to review update ripple-down
monfera Sep 16, 2021
b36aefb
test: more any removals
monfera Sep 16, 2021
640d644
test: all yScale occurrences are numeric
monfera Sep 16, 2021
36d1596
test: minor other unifications
monfera Sep 16, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
refactor: drive by removal of verbose code
monfera committed Sep 16, 2021
commit 09bed4af65bb0410b8ce465b332c69c2178bfaa5
11 changes: 2 additions & 9 deletions packages/charts/src/utils/events.ts
Original file line number Diff line number Diff line change
@@ -33,13 +33,6 @@ export function hasDragged(prevProps: DragCheckProps | null, nextProps: DragChec
return false;
}
const prevLastDrag = prevProps !== null ? prevProps.lastDrag : null;
const nextLastDrag = nextProps !== null ? nextProps.lastDrag : null;

if (prevLastDrag === null && nextLastDrag !== null) {
return true;
}
if (prevLastDrag !== null && nextLastDrag !== null && prevLastDrag.end.time !== nextLastDrag.end.time) {
return true;
}
return false;
const nextLastDrag = nextProps.lastDrag;
return nextLastDrag !== null && (prevLastDrag === null || prevLastDrag.end.time !== nextLastDrag.end.time);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Replacing a hairy control structure and making the logical conditions less redundant

}