-
-
Save richartkeil/f6a1c5d624d98d68a8e1e4440902f11f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
interface Event { | |
public isCritical(): boolean; | |
public getName(): string; | |
public getPayload(): object; | |
} | |
class UserProcessed implements Event { | |
constructor(protected user: firestore.DocumentSnapshot) {} | |
public isCritical() { | |
return true; | |
} | |
public getName() { | |
return "user.processed"; | |
} | |
public getPayload() { | |
return { | |
id: this.user.id, | |
name: this.user.data().name, | |
email: this.user.data().email | |
}; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment