Namespace window resize event, so it may be elegantly unbound #267
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
With pages that require high performance, sometimes with many high-resolution images being rendered concurrently, it's important to be able to debounce the internal
update
call/check.Currently this can be achieved for scrolling (or other rapid-fire events) by passing a custom trigger method to the plugin's
event
setting, and any debouncing magic could be handled (with your utility lib of choice) prior to triggering said event.However, window resize cannot currently be debounced, as is. It's not possible to unbind the resize event that is directly set on the window without actually clobbering any other resize events also attached (perhaps by other libs).
For a simple fix, we can namespace the plugin resize event to allow for easy unbinding where necessary. For example, any window resize debouncing magic could be handled prior to calling the custom
event
.