Skip to content

Commit 5671ac5

Browse files
committed
Cache collection components
1 parent fbd2c34 commit 5671ac5

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

lib/curly/compiler.rb

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,13 +103,16 @@ def compile_collection(block)
103103
items.each_with_index do |item, index|
104104
options = options.merge("#{name}" => item, "#{counter}" => index + 1)
105105
presenter = ::#{item_presenter_class}.new(self, options)
106+
107+
Curly::TemplateHandler.cache_if_key_is_not_nil(self, presenter) do
106108
RUBY
107109

108110
@presenter_classes.push(item_presenter_class)
109111
compile(block.nodes)
110112
@presenter_classes.pop
111113

112114
output <<-RUBY
115+
end
113116
end
114117
options = options_stack.pop
115118
presenter = presenters.pop

0 commit comments

Comments
 (0)