Skip to content

Instantly share code, notes, and snippets.

@FermiDirak
Created January 16, 2022 07:50
Show Gist options
  • Save FermiDirak/08cd3e461d767e94ee1d8bbba3113d0d to your computer and use it in GitHub Desktop.
Save FermiDirak/08cd3e461d767e94ee1d8bbba3113d0d to your computer and use it in GitHub Desktop.
// UserModel.ts
type UserModel = { /* ... */ }
namespace UserService {
function fullName(): string { /* ... */ };
// ...
}
// HappyBirthdayService.ts
function sendMessage(sessionContext: &SessionContext) {
let message = happyBirthdayMessage(sessionContext.user);
sendEmail(user.email, message);
}
function happyBirthdayMessage(user: UserModel) -> String {
return `Happy Birthday, ${UserService.fullName(user)} 🎉`;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment