Closed Eruant closed 6 years ago
I like this idea. Allows partial imports without tree shaking.
Not a huge fan of the f.
prefixes. I think it makes usage less intuitive. This looks awkward:
import curry from 'lb-f/f.curry'
Also, for consistency, maybe use named exports for submodules too. So usage like this:
import { curry } from 'lb-f/curry'
We can loose the f
prefixes.
@skylize If we were to use named exports for the submodules, how would you suggest we expose named exports to the main package?
@Eruant The main package can also import with destructuring.
import { curry } from './curry'
@skylize It wasn't the import I was worried about. It was allowing an export, but that can be done with export {curry}
if I'm reading the docs correctly.
Oh. I see. Yeah, you can actually skip the import
entirely in the main entry and export directly from the underlying file like this:
export { curry } from './curry.mjs'
or maybe it's this, can't quite remember:
export const { curry } from './curry.mjs'
Actually I like what you did here, exporting on default
too :+1:
@skylize It's good to know about exporting directly. I may use that in future.
Firstly each function has been moved to it's own file. This will allow simpler editing should the number of functions increase
Secondly the tests have been moved next to each file. This makes it easier to notice when a test is missing, and allows you to find the test quicker.