Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Export StimulusReflexController constant #672

Merged
merged 1 commit into from
Aug 24, 2023

Conversation

marcoroth
Copy link
Member

@marcoroth marcoroth commented Aug 21, 2023

Type of PR

Enhancement

Description

This pull request exports the StimulusReflexController constant so it can be imported from the stimulus_reflex package.

Why should this be added

We already allow developers to customize the default controller used for the stimulus-reflex identifier by passing in the controller option in the StimulusReflex.initialize(application, options) call.

This pull requests now allows developers to base their default controller off the StimulusReflex controller by inheriting from the StimulusReflexController constant, like:

// controllers/default_controller.js
import { StimulusReflexController } from "stimulus_reflex"

export default class extends StimulusReflexController {
  // extend the `stimulus-reflex` controller
}

and:

import DefaultController from "../controllers/default_controller"

StimulusReflex.initialize(application, { controller: DefaultController })

Checklist

  • My code follows the style guidelines of this project
  • Checks (StandardRB & Prettier-Standard) are passing

@netlify
Copy link

netlify bot commented Aug 21, 2023

Deploy Preview for stimulusreflex ready!

Name Link
🔨 Latest commit 2d774a9
🔍 Latest deploy log https://app.netlify.com/sites/stimulusreflex/deploys/64e3e828d9e5b30008533fad
😎 Deploy Preview https://deploy-preview-672--stimulusreflex.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@marcoroth marcoroth merged commit 0211cad into main Aug 24, 2023
18 checks passed
@marcoroth marcoroth deleted the export-stimulus-reflex-controller branch August 24, 2023 10:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant