TIL

디바운싱과 데코레이터

 

call/apply와 데코레이터, 포워딩

 

ko.javascript.info

디바운싱 구현하면서, 함수 간 호출 시 함수를 포워딩하는 방법과 데코레이팅하는 방법을 익혔다.

확실히 함수를 넘기는 작업을 할 때 알아야하는 것이 어렵고 헷갈리긴 하지만,

막상 쓰고 나면 엄청 좋은 것 같다. 깔끔해짐.

 

예전에 봤던 부분인데도 막상하려니까, 손에 익지도 않고 아리까리 헷갈렸던 부분.

클로저를 확실히 익혀야 이해되는 부분이 있다.

 

 

변수의 유효범위와 클로저

 

ko.javascript.info

 

아래의 글에서는 디바운싱과 쓰로틀링을 자세히 설명한 뒤,

직접 구현보다 lodash나 underscore 라이브러리를 사용하는 것을 추천한다.

 

Debouncing and Throttling Explained Through Examples | CSS-Tricks

The following is a guest post by David Corbacho, a front end engineer in London. We've broached this topic before, but this time, David is going to drive the

css-tricks.com

lodash 라이브러리에서도 주요 함수들을 어떻게 구현하였는지 틈틈히 봐야겠다.

 

Lodash Documentation

_(value) source Creates a lodash object which wraps value to enable implicit method chain sequences. Methods that operate on and return arrays, collections, and functions can be chained together. Methods that retrieve a single value or may return a primiti

lodash.com

 

'TIL' 카테고리의 다른 글

styled components의 tagged template strings가 js문법이었다.  (0) 2022.09.29
변수 이름은 매우 중요했다  (0) 2022.09.28
22.08.02  (0) 2022.08.03
22.04.05  (0) 2022.04.06
22.03.30  (0) 2022.03.31