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

Feature: add warnings #32

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open

Feature: add warnings #32

wants to merge 4 commits into from

Conversation

JuraJuki
Copy link
Contributor

@JuraJuki JuraJuki requested a review from renatoruk August 20, 2020 09:29
Base automatically changed from fix/tests to master August 21, 2020 06:19
Copy link
Contributor

@renatoruk renatoruk left a comment

Choose a reason for hiding this comment

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

Well done! This seems actually really cool as it could benefit users who don't use TypeScript.
Only check small improvements regarding validator function.

Although this will be very beneficial, I believe issue #43 is still unresolved with this PR. This can be confirmed with the current state of usePost test ->

We'll probably need to do some additional digging to fix that, but this is a nice improvement nevertheless.

@@ -63,6 +65,23 @@ export const usePatch = <
) as unknown) as F;
});

const checkValidity = (
Copy link
Contributor

Choose a reason for hiding this comment

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

This function can actually live outside the hook because it's pure and does not rely on some scoped variable. If extracted outside the hook, it would be a little bit lighter to process because the function does not need to be initialized every time the hook is called.

@@ -52,6 +54,18 @@ export const usePost = <
) as unknown) as F;
});

const checkValidity = (serializeModelParam: ActionPostData) => {
Copy link
Contributor

Choose a reason for hiding this comment

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

Check my comment above!

@JuraJuki
Copy link
Contributor Author

JuraJuki commented Sep 9, 2020

@renatoruk extracted, fixed conflicts. What is left to be done is that the model typings issue #43 is resolved

@codecov
Copy link

codecov bot commented Sep 15, 2020

Codecov Report

Merging #32 into master will decrease coverage by 0.07%.
The diff coverage is 80.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #32      +/-   ##
==========================================
- Coverage   85.41%   85.33%   -0.08%     
==========================================
  Files          49       49              
  Lines        1049     1064      +15     
  Branches      161      168       +7     
==========================================
+ Hits          896      908      +12     
- Misses        151      154       +3     
  Partials        2        2              
Impacted Files Coverage Δ
src/hooks/usePatch.ts 88.23% <77.77%> (-3.77%) ⬇️
src/hooks/usePost.ts 89.65% <83.33%> (-1.65%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 0955069...d5773ce. Read the comment docs.

@renatoruk
Copy link
Contributor

Codecov Report

Merging #32 into master will decrease coverage by 0.07%.
The diff coverage is 80.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #32      +/-   ##
==========================================
- Coverage   85.41%   85.33%   -0.08%     
==========================================
  Files          49       49              
  Lines        1049     1064      +15     
  Branches      161      168       +7     
==========================================
+ Hits          896      908      +12     
- Misses        151      154       +3     
  Partials        2        2              

Impacted Files Coverage Δ
src/hooks/usePatch.ts 88.23% <77.77%> (-3.77%) ⬇️
src/hooks/usePost.ts 89.65% <83.33%> (-1.65%) ⬇️
Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 0955069...d5773ce. Read the comment docs.

@JuraJuki I added codecov action to the CI pipeline. Now, after merging master into this branch we got a drop in code coverage. You can see the detailed report here (look for the red squares).

I suggest we increase the coverage for this particular feature and then we merge?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants