I was wondering which one is better, to do a group export or do individual exports:
export const a = 1;
export const b = 2;
// vs
const a = 1;
const b = 2;
export {
a,
b
}
I鈥檓 not sure either is clearly better in every case; so far we鈥檝e been leaving it as a judgement call for the developer.
I like second one
for a few exports and a small file I use the second one. For a large file with only named exports I explicitly export each one to reduce mistakes.
Most helpful comment
for a few exports and a small file I use the second one. For a large file with only named exports I explicitly export each one to reduce mistakes.