8 $ component install component/throttle
12 var throttle = require('throttle');
13 window.onresize = throttle(resize, 200);
16 console.log('height', window.innerHeight);
17 console.log('width', window.innerWidth);
22 ### throttle(fn, wait)
24 Creates a function that will call `fn` at most once every `wait` milliseconds.
26 Supports leading and trailing invocation.
28 `fn` will receive last context (`this`) and last arguments passed to a throttled wrapper before `fn` was invoked.