Skip to content
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

feat: The Computed Column function is passed row, index, and array #464

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

DanKaplanSES
Copy link
Contributor

👀What is this pr about?

The Computed Column function is passed row, index, and array. The latter two are new.

I modeled this change on JavaScript's map() callback parameter.

🚀 Changes

Before:

export interface ComputedColumn extends ColumnOptionsRaw {
  function: (arg0: any) => any;
}

After:

export interface ComputedColumn extends ColumnOptionsRaw {
  function: (arg0: any, index: number, array: any[]) => any;
}

array is a string[]. I'm not sure why anything in this file has an any type, but I used it here to follow conventions.

Along the way, I noticed that the addColumn and addColumns parameters may have the wrong types?

Related

@DanKaplanSES DanKaplanSES marked this pull request as draft January 31, 2024 01:10
@DanKaplanSES
Copy link
Contributor Author

I've decided to convert this to a draft because I'm not sure if the new values will be correct when rows are filtered and/or sorted (or what "correct" means in this context).

@ayonious
Copy link
Owner

@DanKaplanSES Could you split the PR in 3 different ones fixing 3 different Problems? One of them are okay to be merged rest would have some comments

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants