DelayForwardController

DelayForwardController

new DelayForwardController()

Description:
  • INTERNAL CODE DOCUMENTATION COMPLETE

    Delayed Forward Controller

    A Stimulus controller that provides automatic page redirection after a configurable delay. Useful for implementing splash screens, automatic redirects after form submissions, or timed navigation scenarios with user feedback periods.

    Key Features:

    • Configurable delay timing for redirect control
    • Automatic cleanup to prevent memory leaks
    • Timeout management with proper cancellation
    • Immediate activation on controller connection
    • Console logging for debugging redirect behavior
Source:

Extends

  • Controller

Members

timeout

Description:
  • Timer reference for cleanup management. @type {number|null}

Source:

Timer reference for cleanup management. @type {number|null}

Methods

connect()

Description:
  • Initialize controller and start delayed forward process Automatically begins the redirect timer upon connection

Source:

disconnect()

Description:
  • Clean up timeout on controller disconnection Prevents redirect execution if controller is disconnected before timeout completes Essential for preventing memory leaks and unwanted redirects

Source:

forward()

Description:
  • Manage delayed redirect with timeout control Cancels any existing timeout before setting a new one to prevent multiple redirects Uses window.location.href for full page navigation

Source: