Sha256: 14cd69ccb06a2aedec0df1f1c2a1c3d4e0aeef1c46c2ed74f8db18f67659a919

Contents?: true

Size: 476 Bytes

Versions: 2

Compression:

Stored size: 476 Bytes

Contents

# typed: false
# frozen_string_literal: true

module UI
  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.72 app/components/ariadne/turbo/stream_action/component.rb
ariadne_view_components-0.0.71 app/components/ariadne/turbo/stream_action/component.rb