fix(stimulus): on handler having target
This commit is contained in:
parent
2aa6e635f1
commit
ec1ae25bb4
1 changed files with 4 additions and 1 deletions
|
@ -65,7 +65,10 @@ export class ApplicationController extends Controller {
|
|||
FOCUS_EVENTS.includes(targetOrEventName)
|
||||
);
|
||||
} else {
|
||||
invariant(eventNameOrHandler == 'string', 'event name is required');
|
||||
invariant(
|
||||
typeof eventNameOrHandler == 'string',
|
||||
'event name is required'
|
||||
);
|
||||
invariant(handler, 'handler is required');
|
||||
this.onTarget(targetOrEventName, eventNameOrHandler, handler);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue