Reputation: 35
I'm new to using Flow js, and find myself creating a lot of custom type aliases for the different API call responses and other functions. Currently I keep the type alias in the same file where I need it, and export it if I need it elsewhere in the program. But, I'm quickly finding this to become unwieldy / messy. Is there a certain recommended structure of how to organize all of the type aliases?
Thanks.
Upvotes: 2
Views: 1508
Reputation: 36179
You can use flow-typed
directory to define global types and modules like explained in documentation. Other way would be to make some index file on top of some folder structure where you would export all related to this directory types. In my project I have global redux types declared in flow-typed
directory and other types exported from commons
directory.
Upvotes: 3