Skip to content
This repository has been archived by the owner on Jan 16, 2025. It is now read-only.

Always call onChange to provide the OData options on mount #59

Merged
merged 1 commit into from
Dec 8, 2023

Conversation

thgreasi
Copy link
Contributor

@thgreasi thgreasi commented Nov 20, 2023

}
: undefined)}
>
{(data == null || Array.isArray(data)) && (
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we need this?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We already had the Array.isArray(), which we could drop if we drop support for rendering objects in autoUI.
The data == null is necessary for the Filters to be mounted (w/ display: none) even before the initial load of the data, so that they can parse the url (or fallback to defaults) and trigger $setFilters, which triggers onChange, which provides the pine options to the parent component, for it to use them to fetch the data.
Let me leave a comment :)

@thgreasi thgreasi force-pushed the callOnChangeOnMount branch from 9ab957e to 228ee67 Compare December 8, 2023 09:02
@thgreasi thgreasi marked this pull request as ready for review December 8, 2023 09:07
@thgreasi
Copy link
Contributor Author

thgreasi commented Dec 8, 2023

I self-certify!

@thgreasi thgreasi merged commit d3dd612 into main Dec 8, 2023
47 checks passed
@thgreasi thgreasi deleted the callOnChangeOnMount branch December 8, 2023 09:07
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants