I've been wondering how you're solving the following. All the objects coming from the backend are in snake_case:
{ transaction_id: string, transaction_status: string }
What I do is then remodel all objects to use camelCase keys:
{ transactionId: string, transactionStatus: string }
I need the first type for the initial data load (redux) AND there are cases where in the app, I need an immediate response from a direct call to the backend, which would come in snake_case.
The majority of the places in the app uses the second, camelCase shape of the object.
What I have been doing is defining two types:
interface ITransaction { transactionId: string; ...}```
Which is okey but some objects are quite big and it adds lots of extra code. I'm just wondering if I'm missing a trick and there's a better way of solving it without defining two separate types. Thanks