제네레이터, 또는 async함수와 같은 코루틴은 로직을 일시중단(yield또는 await을 통해)할 수 있습니다. 기존의 콜백패턴에선 pause된 상태를 구분 하기 위한 플래그 변수가 필요한데 코루틴 패턴에선 (일시중단할 수 있는)제어흐름으로써 대신 표현가능합니다.
BEFORE:
const el = document.querySelector('.draggable')
let isTouching = false // <= 플래그변수, 로직이 복잡할 수록 늘어남