#react useCallback returns the same function reference if it gets the same dependencies // different function on every render let fn = name => dispatch({type: ADD, name}) // same function on every render let fn = useCallback( name => dispatch({type: ADD, name}), [dispatch] )
1
2
useMemo: will call the function is the dependencies has changed useCallback: will give you a new function that you can call, so it gives you a function rather than the result #javascript #react #reacthooks #useMemo #useCallback
1
1
Аневризма retweeted
so, i'm releasing 2 rather specific libs today. one is cannon-es, a esm port of cannon by @schteppe: github.com/drcmda/cannon-es (looked unmaintained, didn't bother making a PR) and the other is use-cannon, a super rough web worker bridge for physics in react: github.com/drcmda/use-cannon
37
375
2,215
“No por mucho madrugar, amanece más temprano”
1
Аневризма retweeted
Understanding the “Initial”, “Inherit” and “Unset” CSS Keywords medium.com/@elad/understandi… #CSS
1
1
Аневризма retweeted
Clean Code concepts for JavaScript: bit.ly/clean-code-js ~ a huge collection of patterns for writing readable, reusable, and refactorable code. By @ryconoclast
35
1,107
3,569
Аневризма retweeted
🔥 Perfectly aligning checkboxes with text is super annoying, especially when the text wraps on to multiple lines. Here's an approach I use to always perfectly center them with the first line of text, no matter the text length or size 👉 codepen.io/adamwathan/pen/bG…
32
227
1,855
A lo bien, que nivel de mediocridad al que hemos llegado...es que es en serio? #IvanDuqueBoboHijueputa #UnaSolucionParaUberYa
2
Ohh by the way, the dude who thought the “2 adds in a row” he has no feelings, seriously
Dear @YouTube now you become a “box” full of adds, even @xvideoscom and @pornhub don’t abuse the user with that, you are INFINITELY rich...what that fuck?
1
1
Store’s state is so big that redux dev tools can’t handle it. #javascript #react #redux
Аневризма retweeted
9
21
209
Я просто хочу поблагодарить @eggheadio за то, что вы заставляли мою карьеру идёт дальше, чем я ожидал. Пусть так))) I just want to thank @eggheadio for making my career going further than I expected. Keep it that way))) #react #javascript
this is what it looks like when you use ES modules among with CommonJs #javascript #nodejs #react #webpack #rollup
1
1
山 - shān = mountain 出 - chū = get out (it represents two mountains stacked on top of each other, in ancient China, emperors exiled their enemies beyond the mountains, so nowadays exile has become to mean of “get out”) #fuckingawesome #охуйтельно
Аневризма retweeted
How to write a parser? - Understand syntax diagram - How to implement a parser - Handle parsing error lihautan.com/json-parser-wit…
1
57
232
Russian is hard, specially on @code “Переключить вертикальное или горизонтальное расположение окон редактора” Same as: “flip layout” #vscode #javacript #какогохуя