-
Notifications
You must be signed in to change notification settings - Fork 937
DataSnapshot forEach method should be able to return void #555
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
Comments
Hmmm this issue does not seem to follow the issue template. Make sure you provide all the required information. |
Hey there! I couldn't figure out what this issue is about, so I've labeled it for a human to triage. Hang tight. |
Thanks for sending this over @Francescu. We should indeed update the types. If you want to take a stab at this, I would be more than welcome to review your PR. Take a look here: https://github.com/firebase/firebase-js-sdk/blob/master/packages/database-types/index.d.ts |
https://github.com/firebase/firebase-js-sdk/blob/master/packages/database-types/index.d.ts#L78 Can be changed to |
Closing this as it seems things have been taken care of. Thanks! |
TypeScript defs had the same bug (now fixed): firebase/firebase-js-sdk#555 Documentation to back up optional boolean: https://firebase.google.com/docs/reference/js/firebase.database.DataSnapshot#forEach
Code from the doc doesn't use the
return boolean
from theforEach
function when it doesn't want to interrupt the enumeration.Example
Problem
This code is not valid with the current Typescript definitions.
Proposal
I'm new to Firebase so I'd be careful there. But it seems that adding to the closure return type
|void
would fix the issue. I can provide a PR, if you're OK with this solution.The text was updated successfully, but these errors were encountered: