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

feat: default handler now accepts _every_ message type #9

Merged
merged 2 commits into from
Oct 26, 2023

Conversation

dwickr
Copy link
Collaborator

@dwickr dwickr commented Oct 26, 2023

allow downstream integrations to use the default handler to filter out
all the different message types they might want to use. this way we
needn't create setLocationHandler, setCallHandler, etc.

this also modifies the exports of this library to add the MESSAGE_TYPE
map to the WickrBot class. it's not the most elegant way of handling
this, but with the way we're currently doing the exports it is the only
way to export > 1 thing afaik. changing the import behavior is something
for a v2.

This provides better feedback on failures than just asserting if it was
called or not
allow downstream integrations to use the default handler to filter out
all the different message types they might want to use. this way we
needn't create `setLocationHandler`, `setCallHandler`, etc.

this also modifies the exports of this library to add the `MESSAGE_TYPE`
map to the WickrBot class. it's not the most elegant way of handling
this, but with the way we're currently doing the exports it is the only
way to export > 1 thing afaik. changing the import behavior is something
for a v2.
@dwickr dwickr merged commit 4443d84 into master Oct 26, 2023
3 checks passed
@dwickr dwickr deleted the default-handler-receive-everything branch October 26, 2023 14:27
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