Closed PuruVJ closed 3 years ago
Yep fully agree. Go for it :+1:
I didn't see this level of modularity. It makes sense to clean it up.
@Mira-Alf No issue. I've replaced existing one with the much better snippet I provided above
@Mira-Alf @PuruVJ The idea overall was to have a facade around the external library, so that in case we need to switch it out later, we can easily by making changes in a single file.
Yes! I agree. I've added cleanup logic, and some more stuff in that single file. kenny's idea was really good.
I saw a file structure like this in the Twitter refactor:
And the contents look like this.
My question: Is it really necessary to split them up so much? For example, It'll be better to import format directly from date-fns, and it'll convey meaning that it is related to Date formatting only, cuz there might be more formatters later on.
And
const {format} = require('../utils/date')
would be a bit too confusing at first.And if we're doing this, we better do it right. Let's change the file a bit:
What are your thoughts @johnjacobkenny @Mira-Alf ?