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

Enable support for TValue typing of ValueFormatterParams when using ValueFormatterFunc #5609

Open
wants to merge 1 commit into
base: latest
Choose a base branch
from

Conversation

astorije
Copy link

At the moment, we use something like this:

const numericFormatter = ({
  value,
}: ValueFormatterParams<TData, number | undefined>) =>
  value === undefined ? '' : round(value, 2).toFixed(2);

This is great, but type safety can be improved a little further with this change:

const numericFormatter = ({
  value
}): ValueFormatterFunc<TData, number | undefined> =>
  value === undefined ? '' : round(value, 2).toFixed(2);

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.

None yet

1 participant