Sha256: 0fd587584b4ea9ed3adaa328c75f9572a061124a18a8913ceea0bcf0d7d2d9e4

Contents?: true

Size: 479 Bytes

Versions: 38

Compression:

Stored size: 479 Bytes

Contents

# typed: false
# frozen_string_literal: true

module Ariadne
  module Turbo
    module StreamAction
      class Component < Ariadne::BaseComponent
        option :component
        option :action, default: -> { "update" }

        def target
          @target ||= component.component_id
        end

        def turbo_action
          @turbo_action ||= empty? ? "update" : action
        end

        def empty?
          action == "drop"
        end
      end
    end
  end
end

Version data entries

38 entries across 38 versions & 1 rubygems

Version Path
ariadne_view_components-0.0.93.2 app/components/ariadne/turbo/stream_action/component.rb
ariadne_view_components-0.0.93.1 app/components/ariadne/turbo/stream_action/component.rb
ariadne_view_components-0.0.93 app/components/ariadne/turbo/stream_action/component.rb
ariadne_view_components-0.0.92 app/components/ariadne/turbo/stream_action/component.rb
ariadne_view_components-0.0.91 app/components/ariadne/turbo/stream_action/component.rb
ariadne_view_components-0.0.90 app/components/ariadne/turbo/stream_action/component.rb
ariadne_view_components-0.0.89.1 app/components/ariadne/turbo/stream_action/component.rb
ariadne_view_components-0.0.89 app/components/ariadne/turbo/stream_action/component.rb
ariadne_view_components-0.0.88 app/components/ariadne/turbo/stream_action/component.rb
ariadne_view_components-0.0.87 app/components/ariadne/turbo/stream_action/component.rb
ariadne_view_components-0.0.86.9 app/components/ariadne/turbo/stream_action/component.rb
ariadne_view_components-0.0.86.8 app/components/ariadne/turbo/stream_action/component.rb
ariadne_view_components-0.0.86.7 app/components/ariadne/turbo/stream_action/component.rb
ariadne_view_components-0.0.86.6 app/components/ariadne/turbo/stream_action/component.rb
ariadne_view_components-0.0.86.5 app/components/ariadne/turbo/stream_action/component.rb
ariadne_view_components-0.0.86.4 app/components/ariadne/turbo/stream_action/component.rb
ariadne_view_components-0.0.86.3 app/components/ariadne/turbo/stream_action/component.rb
ariadne_view_components-0.0.86.2 app/components/ariadne/turbo/stream_action/component.rb
ariadne_view_components-0.0.86.1 app/components/ariadne/turbo/stream_action/component.rb
ariadne_view_components-0.0.86 app/components/ariadne/turbo/stream_action/component.rb