Class: ReactOnRailsPro::ImmediateAsyncValue
- Inherits:
-
Object
- Object
- ReactOnRailsPro::ImmediateAsyncValue
- Defined in:
- lib/react_on_rails_pro/immediate_async_value.rb
Overview
ImmediateAsyncValue is returned when a cached_async_react_component call has a cache hit. It provides the same interface as AsyncValue but returns the cached value immediately without any async operations.
Instance Attribute Summary collapse
-
#value ⇒ Object
readonly
Returns the value of attribute value.
Instance Method Summary collapse
- #html_safe ⇒ Object
-
#initialize(value) ⇒ ImmediateAsyncValue
constructor
A new instance of ImmediateAsyncValue.
- #resolved? ⇒ Boolean
- #to_s ⇒ Object
Constructor Details
#initialize(value) ⇒ ImmediateAsyncValue
Returns a new instance of ImmediateAsyncValue.
9 10 11 |
# File 'lib/react_on_rails_pro/immediate_async_value.rb', line 9 def initialize(value) @value = value end |
Instance Attribute Details
#value ⇒ Object (readonly)
Returns the value of attribute value.
13 14 15 |
# File 'lib/react_on_rails_pro/immediate_async_value.rb', line 13 def value @value end |
Instance Method Details
#html_safe ⇒ Object
23 24 25 |
# File 'lib/react_on_rails_pro/immediate_async_value.rb', line 23 def html_safe @value.html_safe end |
#resolved? ⇒ Boolean
15 16 17 |
# File 'lib/react_on_rails_pro/immediate_async_value.rb', line 15 def resolved? true end |
#to_s ⇒ Object
19 20 21 |
# File 'lib/react_on_rails_pro/immediate_async_value.rb', line 19 def to_s @value.to_s end |