Native notifications modules JS types can be exact since we established there are no fields in those objects that are not covered by types.
Details
- Reviewers
tomek bartek ashoat - Commits
- rCOMM0f81d4aa56d4: Make types exact
Run flow in native directory. Using console.log ensure types are covering every fields present in those objects.
Diff Detail
- Repository
- rCOMM Comm
- Lint
Lint Not Applicable - Unit
Tests Not Applicable
Event Timeline
Aren't we missing "FETCH_RESULT_NO_DATA", "FETCH_RESULT_NEW_DATA", "FETCH_RESULT_FAILED"? Source here
Okay, just make sure you did this part of the Test Plan so that all constants are included:
Using console.log ensure types are covering every fields present in those objects.
Yes, I used console.log and Object.keys on Android as well and the types comprehensive.
Besides it is quite surprising to me that constants exported via getConstants method are also automatically added to JS object, so they can be accessed directly without getConstants method being called in JS. This makes getConstants in JS redundant, doesn't it? Just curious about this.
It might be for backwards compatibility, or maybe just for convenience of accessing. The idea of getConstants() is that it's called once by the module at initialization, so actually I think calling it directly might also have some nuanced differences if there is some stateful code there