Closed eraygundogmus closed 1 year ago
I am OK with having explicit transformers with each one as we had to battle with all the different responses we got from all the other channels. I am thinking about reaching out to the data/backend team to make it unified across all the responses so that we can do the generalization i am talking about.
For example, this gives us flexibility to not have an icon for a channel type and return a null
until we have the image uploaded, etc.
Though i agree, there are some improvements we can make to make this easier to grasp/use.
I've tried to come up with a solution but both our object shapes and API response shapes vary a lot there's just no point to make it generic since you have to write bunch of if statements.
Even if we see many function below ,
There is only one in a generic way.
And why don't we use enums for API channels?
Let me explain in an easier way.
Now remember the generic transform function above.
Then remove unused 200 line...