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

Add to raise an error when executed multiple times #1

Merged
merged 1 commit into from
Nov 23, 2024

Conversation

taketo1113
Copy link
Owner

Summary

Raise an error to prevent multiple event listeners from being registered when alt-ujs is executed more than once.

Details

If start() is executed twice as shown below:

import AltUjs from "alt-ujs";

AltUjs.start();

...

AltUjs.start();

The following error occurs:

Uncaught Error: alt-ujs: confirm has already been loaded.

(confirm is the module name of alt-ujs that was called twice.)

@taketo1113 taketo1113 self-assigned this Nov 23, 2024
@taketo1113 taketo1113 merged commit 42fc45e into master Nov 23, 2024
3 checks passed
@taketo1113 taketo1113 deleted the raise-error-multi-start branch November 23, 2024 15:33
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