Class: Ruact::Flight::SuspenseElement
- Inherits:
-
Object
- Object
- Ruact::Flight::SuspenseElement
- 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
-
#children ⇒ Object
readonly
Returns the value of attribute children.
-
#delay ⇒ Object
readonly
Returns the value of attribute delay.
-
#fallback ⇒ Object
readonly
Returns the value of attribute fallback.
Instance Method Summary collapse
-
#initialize(fallback:, children:, delay: 1.5) ⇒ SuspenseElement
constructor
A new instance of SuspenseElement.
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
#children ⇒ Object (readonly)
Returns the value of attribute children.
21 22 23 |
# File 'lib/ruact/flight/react_element.rb', line 21 def children @children end |
#delay ⇒ Object (readonly)
Returns the value of attribute delay.
21 22 23 |
# File 'lib/ruact/flight/react_element.rb', line 21 def delay @delay end |
#fallback ⇒ Object (readonly)
Returns the value of attribute fallback.
21 22 23 |
# File 'lib/ruact/flight/react_element.rb', line 21 def fallback @fallback end |