Sha256: 96655c27d37d3248bd7b1b0c60418d1aaec36e8dda377f2dffaa1a56ef027ab5

Contents?: true

Size: 666 Bytes

Versions: 4

Compression:

Stored size: 666 Bytes

Contents

# frozen_string_literal: true

module CableReadyHelper
  include CableReady::Compoundable
  include CableReady::StreamIdentifier

  def stream_from(*keys, html_options: {})
    tag.stream_from(**build_options(*keys, html_options))
  end

  def updates_for(*keys, url: nil, debounce: nil, html_options: {}, &block)
    options = build_options(*keys, html_options)
    options[:url] = url if url
    options[:debounce] = debounce if debounce
    tag.updates_for(**options) { capture(&block) }
  end

  private

  def build_options(*keys, html_options)
    keys.select!(&:itself)
    {identifier: signed_stream_identifier(compound(keys))}.merge(html_options)
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
cable_ready-5.0.0.pre7 app/helpers/cable_ready_helper.rb
cable_ready-5.0.0.pre6 app/helpers/cable_ready_helper.rb
cable_ready-5.0.0.pre5 app/helpers/cable_ready_helper.rb
cable_ready-5.0.0.pre4 app/helpers/cable_ready_helper.rb