Expanding or contracting on resize?

Expanding or contracting on resize?


Is there a way to know if the user is expanding or contracting the
window size even if he changes directions midstream?