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

Component | Graph: Add shouldDataUpdate option to control update behavior #13

Draft
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

rokotyan
Copy link

This PR contains the following tweaks:

  1. The isEqual function in utils/data.ts has been updated to accept an optional skipKeys parameter. This allows ignoring specific keys when comparing objects for equality.

  2. The Graph component has been updated to include a new shouldDataUpdate option in the GraphConfigInterface. This option allows developers to provide a custom function to determine whether the component should update when new data is provided.

    By default, the isEqual function from the utils/data module is used to compare the previous and new data. However, developers can now supply their own comparison logic, which is useful for complex nested data structures where the default equality check may not be sufficient.

    This change improves the flexibility and control over the update behavior of the Graph component, enabling developers to optimize performance and reduce unnecessary re-renders when the data has not meaningfully changed.

The `isEqual` function in `utils/data.ts` has been updated to accept an optional `skipKeys` parameter. This allows ignoring specific keys when comparing objects for equality.

This change improves the flexibility and usefulness of the `isEqual` function, enabling developers to exclude certain keys from the comparison process when needed.
…havior

The `Graph` component has been updated to include a new `shouldDataUpdate` option in the `GraphConfigInterface`. This option allows developers to provide a custom function to determine whether the component should update when new data is provided.

By default, the `isEqual` function from the `utils/data` module is used to compare the previous and new data. However, developers can now supply their own comparison logic, which is useful for complex nested data structures where the default equality check may not be sufficient.

This change improves the flexibility and control over the update behavior of the `Graph` component, enabling developers to optimize performance and reduce unnecessary re-renders when the data has not meaningfully changed.
@rokotyan rokotyan self-assigned this Dec 13, 2024
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.

1 participant