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

Use null instead of undefined to represent "not yet ready" data in the usecases selector. #816

Open
garronej opened this issue Jun 1, 2024 · 0 comments

Comments

@garronej
Copy link
Contributor

garronej commented Jun 1, 2024

I should do this otherwise this kind of issues can arise if I'm not focussed enought:

#804

Using null instead like what I did in this usecase solves it:

https://github.com/InseeFrLab/onyxia/blob/main/web/src/core/usecases/s3ConfigCreation/selectors.ts

This way we don't have to think to much about what entries must be listed here (to know if the value when ready can also be undefined):

assert(formValues !== null);
assert(connectionTestStatus !== null);
assert(formValuesErrors !== null);
assert(isFormSubmittable !== null);
assert(urlStylesExamples !== null);
assert(isEditionOfAnExistingConfig !== null);

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

No branches or pull requests

1 participant