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

DataSnapshot child and forEach type improvements #37

Merged
merged 4 commits into from
Apr 3, 2023

Conversation

appy-one
Copy link
Owner

@appy-one appy-one commented Apr 3, 2023

In addition to @futurGH's great work to implement type generics in #34, I improved the types of the DataSnapshot.child, DataSnapshot.forEach and MutationDataSnapshot.child methods

2) allow overriding child data type

This change allows snap.child('prop') to inherit the type of `prop` set in parent snapshot's type, and `snap.child<number>('some_number')` to explicitly set the child type
Only allows a number for the child index to be passed
@appy-one appy-one self-assigned this Apr 3, 2023
@appy-one appy-one merged commit ee4fd21 into master Apr 3, 2023
@appy-one appy-one deleted the datareference-datasnapshot-generics branch April 3, 2023 09:33
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.

1 participant