I think next step is to replase array of values with a string that incremented with new symbol after a button click. This string also may be printed on the calculator screen. Backend should parse it to perform morse complex calculations.
Great videos, high quality! One improvement is to remove the #result attribute and simplify the rendering logic. #result can be replaced with just the left operand
This particular example is slower because it responds with the entire page, but you can trim down the response to just the result div, which would very fast over websockets. I don't know what the exact benchmarks look like, but I would imagine the JS version would be faster to execute.
It's reasonable to think that, but if you consider that a 3D multiplayer game is essentially doing a similar thing with hundreds of data points per second over a network, even 100 people simultaneously hammering away on a calculator like this is unlikely to tax a small server instance :)
Great tutorial, thanks. Hotwire does have a ton of potential, the fact this was done without touching any JS is amazing.
Thank you for sharing it, I wonder if it is possible to sum 1+49
Sure, you'd have to change the logic a bit though. Maybe add an = sign to signify you're done adding numbers.
I think next step is to replase array of values with a string that incremented with new symbol after a button click. This string also may be printed on the calculator screen. Backend should parse it to perform morse complex calculations.
Thanks Cezar!
This seems almost absurdly complicated for what it is. Might make more sense to do it in JS but it’s good to know this option exists.
Great videos, high quality! One improvement is to remove the #result attribute and simplify the rendering logic. #result can be replaced with just the left operand
This is cool, but wouldn't this be impractically slow across a network if you have to make a roundtrip for every button click?
This particular example is slower because it responds with the entire page, but you can trim down the response to just the result div, which would very fast over websockets.
I don't know what the exact benchmarks look like, but I would imagine the JS version would be faster to execute.
It's reasonable to think that, but if you consider that a 3D multiplayer game is essentially doing a similar thing with hundreds of data points per second over a network, even 100 people simultaneously hammering away on a calculator like this is unlikely to tax a small server instance :)
what is your vscode theme?
I'm not 100%, sure, but I think it was "Community Material Palenight High Contrast".
@@mixandgo thanks!