Hi,
I think having the ability to define multiple values at a top level or destructured requires would be useful for certain notebooks. I’ll use TidyJS as an example to demonstrate part of why I think this would be a helpful feature.
I could require it in a cell directly from the distrubtion with:
T = require('@tidyjs/tidy/dist/umd/tidy.min.js')
Then I could use it like so:
T.tidy(
data,
T.groupBy('key', [
T.summarize({ total: T.sum('value') })
])
)
Alternatively I could wrap the cell in braces and destructure the functions I want:
{
const { tidy, groupBy, summarize, sum } = T;
tidy(
data,
groupBy('key', [
summarize({ total: sum('value') })
])
)
}
Thankfully, there exists a Tidy notebook so I can call
import { tidy, groupBy, summarize, sum } from '@pbeshai/tidyjs'
However, if new functions are added to the library, but are not added to the notebook above, I would rely on the earlier methods.
Therefore, I think it would be valuable for writing clean notebooks to be able to at least write the destructured import:
{ tidy, groupBy, summarize, sum } = require('@tidyjs/tidy/dist/umd/tidy.min.js')
Thank you,
Lukas