verge
verge copied to clipboard
Let viewportW/viewportH methods compare min
The 1.7- viewport methods are simple getters:
$.viewportW() // get viewport width
$.viewportH() // get viewport height
It could be useful to let these support a min parameter that compares and returns boolean:
$.viewportW(min) // true if viewport is at least `min` wide
_.find(list, $.viewportW) // use case
Are there pitfalls in adding the (min) syntax? It seems rather expressive. Going further to add (min, max) would be problematic for the _.find use case above because of the indices.
A separate method like $.between.call(test, min, max) for use like _.find(list, $.between, $.viewportW) is possible alternative.