Sha256: f98637e649c46d9acc32d644565793e2e2211b79b0c2537ec8f649d80041b756

Contents?: true

Size: 481 Bytes

Versions: 2

Compression:

Stored size: 481 Bytes

Contents

# typed: false
# frozen_string_literal: true

module Ariadne
  module Turbo
    module StreamAction
      class Component < ApplicationViewComponent
        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

2 entries across 2 versions & 1 rubygems

Version Path
ariadne_view_components-0.0.74 app/components/ariadne/turbo/stream_action/component.rb
ariadne_view_components-0.0.73 app/components/ariadne/turbo/stream_action/component.rb