You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

27 lines
498 B

import { Controller } from "@hotwired/stimulus"
import { useIntersection } from "stimulus-use"
import { get } from "@rails/request.js"
export default class extends Controller {
static values = {
url: String
}
connect() {
this.fetchingData = false
useIntersection(this)
}
async appear () {
if (this.fetchingData) return
this.fetchingData = true
await get(this.urlValue, { responseKind: "turbo-stream" } )
this.fetchingData = false
}
}