Stop caching threads — YAGNI
This commit is contained in:
@@ -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 +0,0 @@
|
||||
export * from "helpers/timing_helpers"
|
||||
@@ -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()
|
||||
@@ -1,2 +0,0 @@
|
||||
import "initializers/current"
|
||||
import "initializers/local_time"
|
||||
@@ -1,2 +0,0 @@
|
||||
import LocalTime from "local-time"
|
||||
LocalTime.start()
|
||||
Reference in New Issue
Block a user