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

database module typescript definition: update signature is wrong #1329

Closed
phra opened this issue Nov 7, 2017 · 1 comment
Closed

database module typescript definition: update signature is wrong #1329

phra opened this issue Nov 7, 2017 · 1 comment

Comments

@phra
Copy link
Contributor

phra commented Nov 7, 2017

Hi,

there is a bug in the new database typescript definitions.

https://github.com/angular/angularfire2/blob/master/src/database/list/create-reference.ts#L11
i think that line no. 6 should be:

update: createDataOperationMethod<Partial<T>>(query.ref, 'update'),

otherwise the non destructive .update() wants as second arguments a complete T object instead of a Partial.

@phra
Copy link
Contributor Author

phra commented Nov 8, 2017

as a workaround you can double cast the payload as { payload: 'payload' } as any as T in strict environments.

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

No branches or pull requests

1 participant