Class: Proc

Inherits:
Object show all
Defined in:
opal/fron/core_ext/proc.rb

Overview

Proc

Instance Method Summary collapse

Instance Method Details

#debounce(ms, leading = false) ⇒ Object

Runs the given block after the given wait period if called continously. The wait period restarts with each call


15
16
17
# File 'opal/fron/core_ext/proc.rb', line 15

def debounce(ms, leading = false)
  Native `debounce(#{self}, #{ms}, #{leading})`
end

#throttle(ms) ⇒ Object

Runs the given block after the given wait period if called continously


7
8
9
# File 'opal/fron/core_ext/proc.rb', line 7

def throttle(ms)
  Native `throttle(#{self}, #{ms}, {leading: false})`
end