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

Resolve SVG dimensions at runtime #163

Merged
merged 2 commits into from
Feb 21, 2024
Merged

Resolve SVG dimensions at runtime #163

merged 2 commits into from
Feb 21, 2024

Conversation

GalMunGral
Copy link
Contributor

No description provided.

return this.http
.get<BlockSet>(this.urls.get(blockSetId)!, httpOptions)
.pipe(
delayWhen((blockSet) =>
Copy link
Contributor

@matthewberry matthewberry Feb 21, 2024

Choose a reason for hiding this comment

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

btw, I'm probably not thinking it through, but why delayWhen instead of switchMap?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

oh! because the method needs to return a Observable<BlockSet>, and the inner observable is actually a Observable<SvgViewBox[]>. i just needed to wait for it to complete and then emit the original value (blockSet)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I actually used switchMap and mergeMap in my original PR, but then I had second thoughts today and browsed through all available operators and found delayWhen which does exactly what I needed here

@GalMunGral GalMunGral merged commit 67db360 into develop Feb 21, 2024
1 check passed
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.

2 participants