-
Notifications
You must be signed in to change notification settings - Fork 211
Enhance RTDB v2 Triggers #1153
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
Enhance RTDB v2 Triggers #1153
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Q: This is verbatim copy of the existing code right? Do we worry about having to worry about divergence of the code or is that actually desirable in this case?
@taeold Good point, I know we duplicated a bunch of the Event Handler options for better docs so I thought we should also do that here. Ended up moving it the common code path |
src/providers/database.ts
Outdated
import { DataSnapshot } from '../common/providers/database'; | ||
import { firebaseConfig } from '../config'; | ||
import { DeploymentOptions } from '../function-configuration'; | ||
import { normalizePath } from '../utilities/path'; | ||
import { applyChange } from '../utils'; | ||
|
||
export { DataSnapshot }; | ||
export { DataSnapshot, Change }; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think we actually exported Change from the RDTB namespace in the past, did we? IIRC it was just exported in index.ts
. We should put it in v1/index.ts
and v2/index.ts
as well as v2/core.ts
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sounds good, I'll wait for the other PRs to complete first
/** | ||
* `ChangeJson` is the JSON format used to construct a Change object. | ||
*/ | ||
export interface ChangeJson { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this be @internal? Are users actually constructing a ChangeJson?
Trying to make sure we get this in, sync |
This commit resolves faulty merge-conflicted code that did not take into account the changes from #1153.
Change
fromcommon/change.ts
since we're using it in both v1 & v2 functionsreinterpretCast
fromChange
namespaceonValue*