Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Fix: #198 - Error thrown in ngOnDestroy if plot not yet initialized#246

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
andrefarzat merged 1 commit intoplotly:masterfrompaulirwin:issue/198
Aug 7, 2023

Conversation

paulirwin
Copy link
Contributor

This can occur in unit tests if you do not await the component being stable, so thisresolves#198. However, this could also happen if ngOnDestroy is called very quickly after ngOnInit.

Note that the actual error happens inside createFigure, but given that thePlotlyService.remove call needs theplotlyInstance as well, and that other code checksplotlyInstance for truthiness first, this seemed like a reasonable seam to introduce this check.

The provided unit test failed before making this change, so this PR was done via TDD.

One bonus of this change is that it removes a use of the! operator.

…izedThis can occur in unit tests if you do not await the component beingstable, so thisresolvesplotly#198. However, this could also happen ifngOnDestroy is called very quickly after ngOnInit.
@andrefarzatandrefarzat merged commit1f9da25 intoplotly:masterAug 7, 2023
@andrefarzat
Copy link
Collaborator

Thank you,@paulirwin 😸

paulirwin reacted with heart emoji

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers
No reviews
Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

Angular 13: Errors when running Unit Tests
2 participants
@paulirwin@andrefarzat

[8]ページ先頭

©2009-2025 Movatter.jp