공지사항:
2025년 4월 15일 전에 Earth Engine 사용을 위해 등록된 모든 비상업용 프로젝트는 Earth Engine 액세스를 유지하기 위해
비상업용 자격 요건을 인증해야 합니다.
ui.util.debounce
컬렉션을 사용해 정리하기
내 환경설정을 기준으로 콘텐츠를 저장하고 분류하세요.
지정된 간격 (밀리초) 미만으로 반복적으로 실행되는 호출 시퀀스마다 최대 한 번만 호출되도록 함수를 래핑합니다. 이는 결국 실행되도록 하면서 비용이 많이 드는 함수의 호출 수를 줄이는 데 사용할 수 있습니다.
사용 예: ui.Checkbox의 변경 이벤트에 대한 콜백 사용자가 체크박스를 반복해서 클릭하면 체크박스의 마지막 클릭만 콜백을 실행합니다.
디바운스된 함수를 반환합니다.
사용 | 반환 값 |
---|
ui.util.debounce(func, delay, scope) | 함수 |
인수 | 유형 | 세부정보 |
---|
func | 함수 | 디바운스할 함수입니다. |
delay | 숫자 | 함수가 한 번 호출된 후 함수가 실행되도록 허용하기 전에 추가 함수 호출을 위해 지연할 밀리초 수입니다. |
scope | 객체, 선택사항 | 함수를 호출할 범위의 객체입니다. |
달리 명시되지 않는 한 이 페이지의 콘텐츠에는 Creative Commons Attribution 4.0 라이선스에 따라 라이선스가 부여되며, 코드 샘플에는 Apache 2.0 라이선스에 따라 라이선스가 부여됩니다. 자세한 내용은 Google Developers 사이트 정책을 참조하세요. 자바는 Oracle 및/또는 Oracle 계열사의 등록 상표입니다.
최종 업데이트: 2025-07-26(UTC)
[null,null,["최종 업데이트: 2025-07-26(UTC)"],[[["\u003cp\u003eDebounces a function, limiting its execution to at most once within a specified time interval, even with repeated calls.\u003c/p\u003e\n"],["\u003cp\u003eUseful for optimizing expensive functions triggered by frequent events, ensuring only the last call within the interval is executed.\u003c/p\u003e\n"],["\u003cp\u003eReturns a debounced version of the original function, which can be called directly.\u003c/p\u003e\n"],["\u003cp\u003eCustomizable with parameters like \u003ccode\u003edelay\u003c/code\u003e for setting the debounce interval and \u003ccode\u003escope\u003c/code\u003e for controlling the function's execution context.\u003c/p\u003e\n"]]],[],null,["# ui.util.debounce\n\n\u003cbr /\u003e\n\nWraps a function to allow it to be called, at most, once for each sequence of calls fired repeatedly so long as they are fired less than a specified interval apart (in milliseconds). This can be used to reduce the number of invocations of an expensive function while ensuring it eventually runs.\n\n\u003cbr /\u003e\n\nExample use: For the callback to a change event on a ui.Checkbox. If the user clicks the checkbox repeatedly, only the last click of the checkbox will run the callback.\n\nReturns the debounced function.\n\n| Usage | Returns |\n|--------------------------------------------|----------|\n| `ui.util.debounce(func, delay, `*scope*`)` | Function |\n\n| Argument | Type | Details |\n|----------|------------------|------------------------------------------------------------------------------------------------------------------------------------------------|\n| `func` | Function | The function to debounce. |\n| `delay` | Number | After the function is called once, the number of milliseconds to delay for an additional invocation of the function before allowing it to run. |\n| `scope` | Object, optional | Object in whose scope to call the function. |"]]