-
Notifications
You must be signed in to change notification settings - Fork 239
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
Discussion: Refactor background observers to use the same eventEmitter #233
Comments
@GGGava Hey man. Just wanted to loop back to this and see if you had any thoughts on this approach. |
Hey @CaptainJeff, thank you for your contribution! This seems like a very good idea, I just have some questions: 1- Why do we need this new event |
I don't really use it but I think it's used for different measurement categories |
Cool, thank you very much, I believe we can proceed with that 🚀 Regarding the |
Is your feature request related to a problem? Please describe.
In order to listen to multiple measurement types in the background, you have to create 4 event emitters for every type. e.g.
Describe the solution you'd like
It seems like we could refactor this to reuse the 4 events and pass the measurement type as the parameter instead of an empty object
Describe alternatives you've considered
None
Additional context
We could use the following five events (the four listed above plus "sample)
And instead of inserting the type into the string of the event emitter
NSString *successEvent = [NSString stringWithFormat:@"healthKit:%@:setup:success", type];
We could instead pass
And in the js side
I can open a PR for this. I just want to make sure the community agreed this was the right approach first
The text was updated successfully, but these errors were encountered: