新增 30 seconds of code

This commit is contained in:
strick
2021-02-19 10:51:38 +08:00
parent 5adf81439c
commit a3a38df5e8
2 changed files with 54 additions and 0 deletions
+1
View File
@@ -31,6 +31,7 @@
* [GitHub或网络上优秀的面试项目](https://github.com/pwstrick/daily/blob/master/article/github.md)(题量众多,内容饱满)
* [设计模式之美](https://github.com/pwstrick/daily/blob/master/article/pattern.md)
* [浏览器原理](https://github.com/pwstrick/daily/blob/master/article/browser.md)
* [30 seconds of code](https://github.com/pwstrick/daily/blob/master/article/seconds.md)(实用而简短的代码片段)
## 算法
算法包括用一句话描述的算法思路,LeetCode中的题目出现频率以及刷题列表(包含思路和实现)。
+53
View File
@@ -0,0 +1,53 @@
内容来自于国外的《[30 seconds of code](https://www.30secondsofcode.org)》,只翻译了其中的标题,可对其做个整体了解,内容可用 Google 翻译即可。
与 [Underscore.js](https://underscorejs.org/) 和 [Lodash.js](https://lodash.com/docs/) 不同,30 seconds of code中的代码片段都是各自独立的,可直接引用。
## JavaScript
## JavaScript Array Tricks
## JavaScript Algorithms
## CSS
## CSS Centering
## Node.js
## React Hooks
1. [usePersistedState](https://www.30secondsofcode.org/react/s/use-persisted-state)(返回持久存储在localStorage中的状态值,以及用于更新它的函数)
2. [useSSR](https://www.30secondsofcode.org/react/s/use-ssr)(检查代码是否在浏览器或服务器上运行)
3. [useAsync](https://www.30secondsofcode.org/react/s/use-async)(处理异步调用)
4. [useNavigatorOnLine](https://www.30secondsofcode.org/react/s/use-navigator-on-line)(检查客户端在线还是离线)
5. [useFetch](https://www.30secondsofcode.org/react/s/use-fetch)(以声明的方式实现 fetch
6. [useUnload](https://www.30secondsofcode.org/react/s/use-unload)(处理beforeunload窗口事件)
7. [useDebounce](https://www.30secondsofcode.org/react/s/use-debounce)Debounce 给定的值)
8. [useClickInside](https://www.30secondsofcode.org/react/s/use-click-inside)(处理在包装的组件内部单击的事件)
9. [useClickOutside](https://www.30secondsofcode.org/react/s/use-click-outside)(处理在包装的组件外部单击的事件)
10. [useMediaQuery](https://www.30secondsofcode.org/react/s/use-media-query)(检查当前环境是否匹配给定的媒体查询并返回适当的值)
11. [useCopyToClipboard](https://www.30secondsofcode.org/react/s/use-copy-to-clipboard)(将给定的文本复制到剪贴板)
12. [useTimeout](https://www.30secondsofcode.org/react/s/use-timeout)(以声明的方式实现 setTimeout
13. [useComponentDidMount](https://www.30secondsofcode.org/react/s/use-component-did-mount)(挂载组件后立即执行回调)
14. [useComponentWillUnmount](https://www.30secondsofcode.org/react/s/use-component-will-unmount)(在卸载和销毁组件之前立即执行回调)
15. [useInterval](https://www.30secondsofcode.org/react/s/use-interval)(以声明的方式实现 setInterval
16. [usePrevious](https://www.30secondsofcode.org/react/s/use-previous)(存储先前的 state 或 props
17. [useToggler](https://www.30secondsofcode.org/react/s/use-toggler)(提供一个布尔状态变量,可以在其两个状态之间切换)
## React Components
## React Rendering
## React Testing