Using with Turbolinks

onmount is a perfect fit with projects that use Turbolinks.

You'll notice that document.ready is not friendly for Turbolinks applications. You should call $.onmount() when Turbolinks changes pages (page:change event).

$(document).on('ready page:change', function () { $.onmount() })
Debugging
Next: With Rails
    • onmount
    • Premise
    • Features
      • Role attributes
      • Cancelling
      • Preforming cleanups
      • Unique IDs
      • Idempotency
      • Automatic observation
    • Testing
      • Testing
      • Debugging
    • Integrations
      • With Turbolinks
      • With Rails