Stop caching threads — YAGNI

This commit is contained in:
Jose Farias
2024-10-12 23:23:12 -06:00
parent f92d361b14
commit 1d6acb6119
19 changed files with 10 additions and 75 deletions
-1
View File
@@ -1,4 +1,3 @@
// Configure your import map in config/importmap.rb. Read more: https://github.com/rails/importmap-rails
import "@hotwired/turbo-rails"
import "initializers"
import "controllers"
@@ -1,5 +1,5 @@
import { Controller } from "@hotwired/stimulus"
import { nextFrame } from "helpers"
import { nextFrame } from "helpers/timing_helpers"
export default class extends Controller {
static classes = [ "play" ]
@@ -1,5 +1,5 @@
import { Controller } from "@hotwired/stimulus"
import { debounce } from "helpers"
import { debounce } from "helpers/timing_helpers"
export default class extends Controller {
static targets = [ "list" ]
@@ -1,13 +0,0 @@
import { Controller } from "@hotwired/stimulus"
export default class extends Controller {
static classes = [ "myComment" ]
connect() {
this.#myComments.forEach(comment => comment.classList.add(this.myCommentClass))
}
get #myComments() {
return this.element.querySelectorAll(`.comment[data-creator-id='${Current.user.id}']`)
}
}
-1
View File
@@ -1 +0,0 @@
export * from "helpers/timing_helpers"
-15
View File
@@ -1,15 +0,0 @@
class Current {
get user() {
const currentUserId = this.#extractContentFromMetaTag("current-user-id")
if (currentUserId) {
return { id: parseInt(currentUserId) }
}
}
#extractContentFromMetaTag(name) {
return document.head.querySelector(`meta[name="${name}"]`)?.getAttribute("content")
}
}
window.Current = new Current()
-2
View File
@@ -1,2 +0,0 @@
import "initializers/current"
import "initializers/local_time"
@@ -1,2 +0,0 @@
import LocalTime from "local-time"
LocalTime.start()