스트림과 위젯에 대한 디바운스 및 스로틀 기능을 간편하게 구현할 수 있도록 도와주는 가벼운 Flutter 패키지입니다. 콜백의 실행을 지연하거나 제한하는 직관적인 메서드를 제공하여 검색 입력이나 실시간 폼 검증과 같은 상황에서 성능을 향상시킵니다. Stream과 WidgetBuilder와 원활하게 통합되어 Flutter의 반응형 UI 프레임워크 내에서 쉽게 사용할 수 있습니다. 뼈대 코드 없이 깔끔하고 재사용 가능한 로직을 원하는 개발자를 위한 것입니다.
사용 사례
실시간 검색 입력 처리
지연이 있는 폼 필드 검증
API 호출 빈도 감소
사용자 입력 처리 최적화
스트림 기반 이벤트 흐름 제어
UI 반응성 향상
주요 기능
간단한 디바운스 및 스로틀 API
스트림 통합
WidgetBuilder 지원
최소한의 보일러플레이트
크로스 플랫폼 호환성
깔끔하고 읽기 쉬운 구문
적합한 대상
인터랙티브 폼을 개발하는 개발자
자주 사용자 입력이 있는 앱
성능 중심의 UI 컴포넌트
Flutter 초보자가 반응형 패턴을 배우는 중
유지보수 가능한 코드를 우선시하는 팀
고려 사항
고주파, 저지연 이벤트에 적합하지 않음
Streams에 대한 이해가 필요합니다
기본적인 디바운스/스로틀링 외에 사용자 정의 옵션이 제한적
간단한 사용 사례에 약간의 오버헤드가 추가될 수 있습니다
비동기 작업 또는 부작용과 함께 사용하는 것이 가장 좋습니다
원본 README
연결된 소스 저장소의 README 원문 스냅샷입니다. 최신 내용은 저장소에서 확인하세요.
Easy Debounce Throttle
An easy-to-use flutter package that provides debounce and throttle with Stream and WidgetBuilder.
Usage
If you want to subscribe to debounce, throttle events with Stream, use EasyDebounce, EasyThrottle
you should call the close() method to avoid memory leak
If you want to receive debounce and throttle events from methods such as onPressed callbacks with WidgetBuilder, use EasyDebounceBuilder and EasyThrottleBuilder.
EasyDebounceBuilder and EasyThrottleBuilder internally disposes the stream, so there is no need to call the close() method.
MIT LicenseCopyright (c) 2022 seosh817
Permissionis hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Softwareis
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.