lib/volt/page/bindings/each_binding.rb
def remove
      @computation.stop
      @computation = nil

      # Clear value
      @value       = []

      if @added_listener
        @added_listener.remove
        @added_listener = nil
      end

      if @removed_listener
        @removed_listener.remove
        @removed_listener = nil
      end

      if @templates
        template_count = @templates.size
        template_count.times do |index|
          item_removed(template_count - index - 1)
        end
        # @templates.compact.each(&:remove)
        @templates = nil
      end

      super
    end
# When this each_binding is removed, cleanup.
When this each_binding is removed, cleanup.
When this each_binding is removed cleanup .
def remove
      @computation.stop
      @computation = nil
      @value       = []
      if @added_listener
        @added_listener.remove
        @added_listener = nil
      end
      if @removed_listener
        @removed_listener.remove
        @removed_listener = nil
      end
      if @templates
        template_count = @templates.size
        template_count.times do |index|
          item_removed(template_count - index - 1)
        end
        @templates = nil
      end
      super
    end
def remove @computation . stop @computation = nil @value = [ ] if @added_listener @added_listener . remove @added_listener = nil end if @removed_listener @removed_listener . remove @removed_listener = nil end if @templates template_count = @templates . size template_count . times do | index | item_removed ( template_count - index - 1 ) end @templates = nil end super end
When this each_binding is removed, cleanup.
When this each_binding is removed cleanup .
# Clear value # @templates.compact.each(&:remove)