Class: Ruact::Flight::SuspenseElement

Inherits:
Object
  • Object
show all
Defined in:
lib/ruact/flight/react_element.rb

Overview

Represents a React Suspense boundary. ‘fallback` is a ReactElement shown while the deferred content is loading. `children` is the actual content (emitted as a deferred row after `delay` seconds).

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(fallback:, children:, delay: 1.5) ⇒ SuspenseElement

Returns a new instance of SuspenseElement.



23
24
25
26
27
# File 'lib/ruact/flight/react_element.rb', line 23

def initialize(fallback:, children:, delay: 1.5)
  @fallback  = fallback
  @children  = children
  @delay     = delay
end

Instance Attribute Details

#childrenObject (readonly)

Returns the value of attribute children.



21
22
23
# File 'lib/ruact/flight/react_element.rb', line 21

def children
  @children
end

#delayObject (readonly)

Returns the value of attribute delay.



21
22
23
# File 'lib/ruact/flight/react_element.rb', line 21

def delay
  @delay
end

#fallbackObject (readonly)

Returns the value of attribute fallback.



21
22
23
# File 'lib/ruact/flight/react_element.rb', line 21

def fallback
  @fallback
end