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

Merge multiple listeners into one #8

Open
timii opened this issue Jul 8, 2022 · 0 comments
Open

Merge multiple listeners into one #8

timii opened this issue Jul 8, 2022 · 0 comments
Assignees
Labels
enhancement New feature or request other Issue about some other functionality

Comments

@timii
Copy link
Owner

timii commented Jul 8, 2022

Currently, we use multiple functions that call sendMessage just with different action. So make the code cleaner, the goal is to merge all the functions into one function that takes the following arguments:

  • action as a string to call different listeners
  • currentTab as a tab object to use the id of the currentTab in the sendMessage function
  • args as an object with additional information for the specific use case

Additionally, we can merge the listeners into one big listener with a switch case for the different actions, so only one listener per file should be needed. Possibly change single-time requests into a long-lived connections

@timii timii added the other Issue about some other functionality label Jul 8, 2022
@timii timii self-assigned this Jul 8, 2022
@timii timii changed the title Refactor code to merge multiple "sendMessage" functions into one Refactor code Jul 21, 2022
@timii timii changed the title Refactor code Merge multiple listeners into one Jul 24, 2022
@timii timii added the enhancement New feature or request label Aug 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request other Issue about some other functionality
Projects
None yet
Development

No branches or pull requests

1 participant