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

[APM] Replace idx usage with optional chaining #50758

Closed
dgieselaar opened this issue Nov 15, 2019 · 1 comment · Fixed by #50849
Closed

[APM] Replace idx usage with optional chaining #50758

dgieselaar opened this issue Nov 15, 2019 · 1 comment · Fixed by #50849
Labels
Team:APM All issues that need APM UI Team support technical debt Improvement of the software architecture and operational architecture

Comments

@dgieselaar
Copy link
Member

Now that we've upgraded to TypeScript 3.7, we can investigate replacing our usage of idx with the optional chaining operator. E.g., we can replace:

const errorUrl = idx(error, _ => _.error.page.url);

with:

const errorUrl = error.error.page?.url;

This might expose some issues in our code as well, because using idx anywhere in the chain seems to make all properties of the returned object available (with DeepRequired).

@dgieselaar dgieselaar added the Team:APM All issues that need APM UI Team support label Nov 15, 2019
@elasticmachine
Copy link
Contributor

Pinging @elastic/apm-ui (Team:apm)

@dgieselaar dgieselaar added the technical debt Improvement of the software architecture and operational architecture label Nov 15, 2019
dgieselaar added a commit to dgieselaar/kibana that referenced this issue Nov 16, 2019
dgieselaar added a commit to dgieselaar/kibana that referenced this issue Nov 20, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Team:APM All issues that need APM UI Team support technical debt Improvement of the software architecture and operational architecture
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants