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

AvMessages | create pre-defined event names/methods #98

Open
GoPro16 opened this issue Mar 27, 2019 · 1 comment
Open

AvMessages | create pre-defined event names/methods #98

GoPro16 opened this issue Mar 27, 2019 · 1 comment

Comments

@GoPro16
Copy link
Contributor

GoPro16 commented Mar 27, 2019

Right now a lot of the apps we have contain hardcoded event names in order to send messages to different apps so that each app's state can be updated accordingly. The AvMessage package is simple for dispatching events to the browser and it would be nice to do, one or both of the following options:

1 - Create Pre-defined set of event names that we have considered to use for our apps. By doing this we can have a better understanding of all the values we are passing around all these apps.

Ex:

// Constants is an export from `avMessages`
avMessages.subscribe(Constants.FAVORITES_UPDATED,(favorites) => {
// Update your favorites inside your component
});

2 - Create a package containing methods that already have these pre-defined event names filled in and formats the data returned easily for both sending and receiving updates.

Ex:

avMessages.onFavoritesUpdated((favorites) => {
// Update your favorites inside your component
});

With either decision we can at least include a readme of what we are expected to send/receive with each of the pre-defined values. It is also possible that we ditch this strategy and identify all the components this package has to live in and just create react components out of them so the users don't have to worry about implementing this.

@robmcguinness
Copy link
Contributor

I think both:

  • create constants that can be exported out to other packages (ex: hearts module)
  • create helper methods that leverage constants

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants