introducing statechanged

This allows some functionality to be triggered on every resize, while other funcitonality is only triggered when states change, e.g. from small to medium