lib/stimulus_reflex/reflex.rb in stimulus_reflex-3.4.0.pre5 vs lib/stimulus_reflex/reflex.rb in stimulus_reflex-3.4.0.pre6
- old
+ new
@@ -3,11 +3,10 @@
ClientAttributes = Struct.new(:reflex_id, :reflex_controller, :xpath, :c_xpath, :permanent_attribute_name, keyword_init: true)
class StimulusReflex::Reflex
include ActiveSupport::Rescuable
include ActiveSupport::Callbacks
- include CableReady::Broadcaster
define_callbacks :process, skip_after_callbacks_if_terminated: true
class << self
def before_reflex(*args, &block)
@@ -43,11 +42,11 @@
options[to] = Array(options[to]).unshift(from)
end
end
end
- attr_reader :channel, :url, :element, :selectors, :method_name, :broadcaster, :client_attributes, :logger
+ attr_reader :cable_ready, :channel, :url, :element, :selectors, :method_name, :broadcaster, :client_attributes, :logger
alias_method :action_name, :method_name # for compatibility with controller libraries like Pundit that expect an action name
delegate :connection, :stream_name, to: :channel
delegate :flash, :session, to: :request
@@ -62,9 +61,10 @@
@method_name = method_name
@params = params
@broadcaster = StimulusReflex::PageBroadcaster.new(self)
@logger = StimulusReflex::Logger.new(self)
@client_attributes = ClientAttributes.new(client_attributes)
+ @cable_ready = StimulusReflex::CableReadyChannels.new(stream_name)
self.params
end
def request
@request ||= begin