Skip to content

Instantly share code, notes, and snippets.

@shlomokraus
Last active January 20, 2019 20:17
Show Gist options
  • Save shlomokraus/94f897d5e6cfcb44d006b95b03f721ac to your computer and use it in GitHub Desktop.
Save shlomokraus/94f897d5e6cfcb44d006b95b03f721ac to your computer and use it in GitHub Desktop.
Example of UserService
export interface IUser {
id: string;
name: string;
email: string;
}
export class UserService {
constructor(private readonly db){}
async getUser(id: string):Promise<IUser>{
const user = await this.db.findOneById(id);
return {
id: user.id,
name: user.name,
email: user.email
};
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment