202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
|
# File 'lib/reactive_record/active_record/reactive_record/while_loading.rb', line 202
def while_loading(display = "", &loading_display_block)
loaded_children = []
loaded_children = block.call.dup if block
loading_children = [display]
loading_children = RenderingContext.build do |buffer|
result = loading_display_block.call
buffer << result.to_s if result.is_a? String
buffer.dup
end if loading_display_block
RenderingContext.replace(
self,
React.create_element(
ReactiveRecord::WhileLoading,
loading: waiting_on_resources,
loading_children: loading_children,
loaded_children: loaded_children,
element_type: type,
element_props: properties)
)
end
|