File tree Expand file tree Collapse file tree 2 files changed +4
-2
lines changed
ruby/examples/misc/stock-tickers/app/hyperstack/components Expand file tree Collapse file tree 2 files changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -5,7 +5,7 @@ class App < HyperComponent
55 @symbols . sort . each do |symbol |
66 LI ( key : symbol ) do
77 DisplayTicker ( symbol : symbol , key : symbol )
8- BUTTON { 'cancel' } . on ( :click ) { mutate @symbols . delete ( symbol ) }
8+ . on ( :cancel ) { mutate @symbols . delete ( symbol ) }
99 end
1010 end
1111 end
Original file line number Diff line number Diff line change 11class DisplayTicker < HyperComponent
22 param :symbol
3+ param :on_cancel , type : Proc
34 before_mount { @ticker = StockTicker . new ( params . symbol , 10 . seconds ) }
45 render ( DIV ) do
5- "#{ params . symbol . upcase } current price: #{ @ticker . price } "
6+ SPAN { "#{ params . symbol . upcase } current price: #{ @ticker . price } " }
7+ BUTTON { 'cancel' } . on ( :click ) { params . on_cancel }
68 end
79end
You can’t perform that action at this time.
0 commit comments