Method: Browser::AnimationFrame#initialize

Defined in:
opal/browser/animation_frame.rb

#initialize(window, &block) ⇒ AnimationFrame

Execute the block to update an animation before the next repaint.

Parameters:

  • window (Window)

    the window to request the frame on



21
22
23
24
25
# File 'opal/browser/animation_frame.rb', line 21

def initialize(window, &block)
  @window = window
  @native = window.to_n
  @id     = request(block)
end