4 ms·
It's closer to React than View Components and anything Rails-related... Here's a clock that updates every second. :ruby def mount loop do
by quechimba 4y ago
It's closer to React than View Components and anything Rails-related...
Here's a clock that updates every second.
:ruby
def mount
loop do
update(time: Time.now)
sleep 1
end
end
%p= Current time: #{state[:time]}
I don't know if it's possible to do that with View Components.
- deleted 4y ago[deleted]
- theonething 4y agoAh, gotcha. Yes, I was under the impression that View Components were very React like, but your framework is actually so. Thanks!