rubycentral/cfp-app

View on GitHub
app/javascript/controllers/sponsors_footer_controller.js

Summary

Maintainability
A
0 mins
Test Coverage
import { Controller } from 'stimulus'

export default class extends Controller {
  static values = {
    eventSlug: String
  }

  connect() {
    const path = `/${this.eventSlugValue}/sponsors_footer`
    fetch(path)
      .then((res) => res.text())
      .then((html) => {
        const fragment = document
          .createRange()
          .createContextualFragment(html);
        this.element.appendChild(fragment);
      })
  }
}