Retrospring/app/javascript/retrospring/controllers/hotkey_controller.ts

13 lines
268 B
TypeScript

import { Controller } from "@hotwired/stimulus";
import { install, uninstall } from "@github/hotkey";
export default class extends Controller<HTMLElement> {
connect(): void {
install(this.element);
}
disconnect(): void {
uninstall(this.element);
}
}