-
Notifications
You must be signed in to change notification settings - Fork 33
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make id optional #114
Comments
The only issue is that
|
Wouldn't adding more checks in Something like: constructor({
header,
footer,
plugins,
cell,
accessor,
id,
}: DataColumnInit<Item, Plugins, Id, Value>) {
super({ header, footer, plugins, id: 'Initialization not complete' });
this.cell = cell;
if (accessor instanceof Function) {
this.accessorFn = accessor;
} else {
this.accessorKey = accessor;
}
if (id === undefined && this.accessorKey === undefined && header === undefined) {
throw new Error('A column id or string accessor or header is required');
}
this.id = (id ?? String(this.accessorKey) ?? String(header)) as Id;
} |
That could work! Unfortunately, I've been extremely busy so this project has been on the back-burner for me. Could you help open a PR for it? I would love to merge any PR you have if you could provide one. |
Can we just make
id
intable.column()
with function accessor andtable.display()
optional? Sinceheader
is already unique in most cases, we can use that as default value forid
.The text was updated successfully, but these errors were encountered: