Useful Patterns
How to build a great StimulusReflex application
Client Side
Application controller
import { Controller } from 'stimulus'
import StimulusReflex from 'stimulus_reflex'
export default class extends Controller {
connect () {
StimulusReflex.register(this)
}
sayHi () {
console.log('Hello from the Application controller.')
}
}import ApplicationController from './application_controller'
export default class extends ApplicationController {
sayHi () {
super.sayHi()
console.log('Hello from a Custom controller')
}
}Benchmarking your Reflex actions
Spinners for long-running actions
Autofocus text boxes
Offering visual feedback
Capture all DOM update events
Capture jQuery events with DOM event listeners
Access Stimulus controller instances
Server-Side
Rendering views inside of a Django model
Triggering custom events and forcing DOM updates
Coming Soon: Notifications
Anti-Patterns
Coming Soon: How to change the URL rendered by a reflex
Last updated