These rules are adopted from the AngularJS commit conventions.
const Foo = ({ result }) => <ResultComponent result={result} />; | |
const withRequest = BaseComponent => ({ bar, ...props }) => { | |
const { result, loading, error } = useRequest(bar); | |
return ( | |
<BaseComponent {...props} result={result} loading={loading} error={error} /> | |
); | |
}; | |
const withError = branch(({ error }) => error, ErrorComponent); | |
const withLoading = branch(({ loading }) => loading, LoadingComponent); | |
export default compose( |
// Engine | |
const React = { | |
index: 0, | |
state: [], | |
useEffect: (callback, dependencies) => { | |
const cachedIndex = React.index; | |
const hasChanged = dependencies !== React.state[cachedIndex]; | |
if (dependencies === undefined || hasChanged) { | |
callback(); |
.next | |
__generated__ |
์์ฆ ๋ฐ๋ผ ๊ณผ๊ฑฐ ์ ํํ๋ 2016๋
์ ์๋ฐ์คํฌ๋ฆฝํธ๋ฅผ ๋ฐฐ์ฐ๋ ๊ธฐ๋ถ์ด๋ผ๋ ๊ธ์ด ๋ ์ค๋ฅธ๋ค.
๊ทธ๋๋ ๊ผฌ๊ผฌ๋ง ์ ์
๊ฐ๋ฐ์์๊ณ ์ด์ฐจํผ ๊ธ์ ๋ด๋ ์๋ฌด๋ฐ ๋ด์ฉ๋ ์ดํดํ ์ ์์๊ณ ์คํ์ฌ ์ธ๊ณ์ด์ ๊ฐ๊น๊ฒ ๋ณด์์๋๋ฐ ์์ฆ์ ์ผ์ถ ์.. ์ด๋ฐ ์์ ์ด ์์๊ตฌ๋ ์์ผ ๋ง์ ์๊ฐ์ด ๋ ๋ค.
ํ์ฌ 2023๋
์ด ๋ ์ง๊ธ ํ๋ก ํธ์๋ ๊ฐ๋ฐ์๋ฅผ ๊ฟ๊พธ๋ ์ด๋ฆฐ ํ์๋ค๋ ์ ์
๊ฐ๋ฐ์๋ค๋ ์ ๋ง ๋ง์์ก๋ค.
๊ทธ๋ค๊ณผ ๋น๊ตํ๋ฉด ๋ ๋จผ์ ์์ํ๊ฒ ์ ๋ถ์ธ๋ฐ ์กฐ๊ธ์ ๋ ์ฝ๊ฒ ์์ํ๊ฒ ์๋๊น ํญ์ ๋ฐ์ฑํ๊ฒ ๋๋ค.
์ด ๊ธ๋ก ๊ทธ๊ฐ ๋๊ผ๋ ์๋์ ๋ณํ๋ฅผ ์์ฑํ๊ณ ํ๋ฒ ์ ๋ฆฌํด๋ณด๊ณ ์ ํ๋ค.
>์ฐ๋ ๋ณ ํ์๋ผ์ธ์ ๋ชฉ์ฐจ๋ก ์ด ๊ธ์ ์์ฑํ์ผ๋ฉฐ ๊ธฐ์ ์์ค์ด๋ ์๊ธฐ์ ์ด๊ธ๋จ์ด ์์ ์๋ ์์ต๋๋ค.