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

getPressure: add Promise<> and undefined to types #2422

Merged
merged 1 commit into from
Nov 1, 2023

Conversation

bobrippling
Copy link
Contributor

Some small typescript and doc tweaks to getPressure

@gfwilliams
Copy link
Member

Thanks!

@gfwilliams
Copy link
Member

I guess it raises the question of whether we should actually make getPressure always return a promise - but that doesn't help firmwares that are out there already

@gfwilliams gfwilliams merged commit e4308c2 into espruino:master Nov 1, 2023
15 checks passed
@bobrippling bobrippling deleted the getpressure-ts branch November 1, 2023 08:41
@bobrippling
Copy link
Contributor Author

Yeah, although I suppose if we always return a promise, then for hardware without a barometer, we'd (probably) choose to resolve with undefined. So I think how things currently are is better, since then a caller will find out immediately whether they'll get a pressure reading, rather than when the promise resolves.

@gfwilliams
Copy link
Member

Yes, I was thinking we might reject the promise - but as you say that would be harder to track down as it won't have a stack trace

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