UNPKG

@stimulus-library/controllers

Version:

A library of useful controllers for Stimulus

18 lines (17 loc) 405 B
import { BaseController } from "@stimulus-library/utilities"; export class RefreshPageController extends BaseController { get onLoad() { return this.hasOnLoadValue ? this.onLoadValue : false; } connect() { if (this.onLoad) { this.refresh(); } } refresh() { location.reload(); } } RefreshPageController.values = { onLoad: Boolean, };