hyper-react icon indicating copy to clipboard operation
hyper-react copied to clipboard

add render_while_loading

Open janbiedermann opened this issue 6 years ago • 1 comments

the render_while_loading block would be called when a component child is loading, as error handler implemented using after_error. Is there a better way? This is not compatible with

render do
end.while_loading do
end

The while_loading block will never be reached.

janbiedermann avatar Feb 05 '18 19:02 janbiedermann

for these we should use a call back

class Foo < Hyperloop::Component
  while_loading do
    IMG(src: 'spinner.png')
   end
   ...
end

and to be completely consistent with the render call back it should allow the same signature as render:

class Foo < Hyperloop::Component
  while_loading(IMG, src: 'spinner.png')
   ...
end

catmando avatar Feb 06 '18 19:02 catmando