-
Notifications
You must be signed in to change notification settings - Fork 88
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
dispatch: modify dispatch to accept Event object instead of eventType and options #9
Comments
The main reason why I've added I am not sure what your You can achieve a similar effect without modifying or extending const dispatchArgs = actionEvent(actionCreator(/* possible data here */));
dispatch(host, ...dispatchArgs); In this way, your What do you think? |
Unfortunately, I can't rely on developers of all skill levels understanding dispatch(host, 'action-event', actionCreator(/* data here */)) This has the benefit of matching the existing |
After all you can also hide implementation details into the dispatchAction(host, /* data here */);
// and inside of the dispatchAction
function dispatchAction(host, /* data here */) {
...
dispatch(host, 'action-event', { ..., detail: action });
} |
That's a great idea, also! Thank you. |
Hello again.
Any chance you can modify
dispatch
to accept an Event object directly? The idea is to dispatch that Event if provided, or else fall back to the current functionality of creating a new CustomEvent for the developer.I'd like to create event "envelopes" that team members can use to provide variable information in an expected format to ancestor event handlers.
For example, here's what I'd like to do:
The alternative is calling dispatchEvent manually, which might confuse some developers as it requires writing different code for what is fundamentally the same concept:
Or, even worse:
I know it's a minor request, but it's one that could provide some nice conformity to end users.
The text was updated successfully, but these errors were encountered: