Closed gozart1 closed 5 years ago
Think of it like this: in the same way that class is a bridge connecting HTML to CSS, data-controller is a bridge from HTML to JavaScript.
Sounds like a cool way to create a little order out of our growing mess of js.
Thumbs up.
Will this create any changes visible to the user, or will it improve code readability?
resolved by PR https://github.com/decred/dcrdata/pull/498 (for home and mempool). @gozart1 Think this is worth more refactoring? Seems like it might be.
It's likely this explorer will continue to get fancier with client side interactions such as charts or table sorts, but at the same time will most likely continue to be based on server rendered html at its core.
So might be good to add a bit of structure to our javascript with Stimulus, a framework that's designed for the turbolinks architecture. https://stimulusjs.org/handbook/origin
What do ya'll think?