Class: Solana::Ruby::Kit::Subscribable::ReactiveActionState
- Inherits:
-
Object
- Object
- Solana::Ruby::Kit::Subscribable::ReactiveActionState
- Extended by:
- T::Sig
- Defined in:
- lib/solana/ruby/kit/subscribable/reactive_action_store.rb
Overview
Lifecycle snapshot of a ReactiveActionStore. ‘data` persists across running/error states so callers can render stale content while a retry is in flight; only reset() clears it.
Mirrors TypeScript’s ReactiveActionState<TResult>.
Instance Attribute Summary collapse
-
#data ⇒ Object
readonly
Returns the value of attribute data.
-
#error ⇒ Object
readonly
Returns the value of attribute error.
-
#status ⇒ Object
readonly
Returns the value of attribute status.
Instance Method Summary collapse
- #==(other) ⇒ Object
-
#initialize(status:, data: nil, error: nil) ⇒ ReactiveActionState
constructor
A new instance of ReactiveActionState.
Constructor Details
#initialize(status:, data: nil, error: nil) ⇒ ReactiveActionState
Returns a new instance of ReactiveActionState.
30 31 32 33 34 35 |
# File 'lib/solana/ruby/kit/subscribable/reactive_action_store.rb', line 30 def initialize(status:, data: nil, error: nil) @status = T.let(status, String) @data = T.let(data, T.untyped) @error = T.let(error, T.untyped) freeze end |
Instance Attribute Details
#data ⇒ Object (readonly)
Returns the value of attribute data.
24 25 26 |
# File 'lib/solana/ruby/kit/subscribable/reactive_action_store.rb', line 24 def data @data end |
#error ⇒ Object (readonly)
Returns the value of attribute error.
27 28 29 |
# File 'lib/solana/ruby/kit/subscribable/reactive_action_store.rb', line 27 def error @error end |
#status ⇒ Object (readonly)
Returns the value of attribute status.
21 22 23 |
# File 'lib/solana/ruby/kit/subscribable/reactive_action_store.rb', line 21 def status @status end |
Instance Method Details
#==(other) ⇒ Object
38 39 40 41 42 43 |
# File 'lib/solana/ruby/kit/subscribable/reactive_action_store.rb', line 38 def ==(other) other.is_a?(ReactiveActionState) && @status == other.status && @data.equal?(other.data) && @error.equal?(other.error) end |