-
-
Notifications
You must be signed in to change notification settings - Fork 615
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
docs: Optimized readme.md code format #1681
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
This pull request is automatically built and testable in CodeSandbox. To see build info of the built libraries, click here or the icon next to each commit SHA. Latest deployment of this branch, based on commit cf4fdb5:
|
The partial code is intentional to reduce the lines of readme. Does it seem too confusing? btw, I didn't know prettier didn't work for readme.md. |
readme.md
Outdated
|
||
function Status() { | ||
// Re-renders the component after urlAtom changed and the async function above concludes | ||
const [json] = useAtom(fetchUrlAtom) | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This one looks a bit strange.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You're right ~,Can I replace it with this ?
function Status() {
// Re-renders the component after urlAtom changed and the async function above concludes
const [json] = useAtom(fetchUrlAtom);
useEffect(()=>{
// Logical processing base on json
console.log(json)
},[json])
return <div>Content</div>;
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That seems over-complicated. We want to keep readme very compact, and move detailed things into ./docs/
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Got it , thanks .
The partial code looks a little uncomfortable, Maybe it's just my personal habit ~ 😂 |
I heard similar comments in zustand, so you are not alone, though. |
readme.md
Outdated
<button onClick={() => setCount((c) => c + 1)}>one up</button> | ||
</h1> | ||
) | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
<button onClick={() => setCount((c) => c + 1)}>one up</button> | |
</h1> | |
) | |
} | |
<button onClick={() => setCount((c) => c + 1)}>one up</button> | |
... |
How about adding ...
to make it explicit that it's partial code?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good idea~ , It works
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shall I modify it and commit merge request again?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, please modify entirely with the said policy.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Got it~!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's done, but some places }
seem more suitable, use }
instead of ...
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Getting good 👍 ! Added two comments.
#1681 (comment) |
Got it! like this ? |
43a6846
to
cf4fdb5
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!!!
Unfortunately, we need to revert this too: |
😂 I resubmitted a copy of the code,is it ok? |
Should be good. Thanks! |
Thank you for your guidance ~ |
Summary
Optimized readme.md code format
Check List
yarn run prettier
for formatting code and docs