Skip to content

Instantly share code, notes, and snippets.

@richartkeil
Last active August 8, 2020 03:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save richartkeil/b816a736a420317edd61804f5e2de3f0 to your computer and use it in GitHub Desktop.
Save richartkeil/b816a736a420317edd61804f5e2de3f0 to your computer and use it in GitHub Desktop.
const processUser = functions.firestore
.document("accounts/{accountId}/users/{userId}")
.onCreate(async (snapshot, context) => {
await processTheUser(snapshot);
const event = new UserProcessed(snapshot);
await new Account(context.params.accountId).addEvent(event);
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment