(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
@Component({ | |
// ... | |
}) | |
export class SignInComponent { | |
onSubmit(): void { | |
this.store.dispatch( | |
new SignIn({ | |
email: this.form.value.email, | |
password: this.form.value.password, | |
}) |
/** | |
* groupWordsByHavingSameLetters | |
* | |
* Group the below words by having the same letter but different position | |
* | |
* @param {Array<string>} arr | |
* @returns {Array<string>} | |
*/ | |
const groupWordsByHavingSameLetters = arr => | |
Object |
const records = [ | |
{ id: 'a', category: 1 }, | |
{ id: 'b', category: 2 }, | |
{ id: 'c', category: 3 }, | |
{ id: 'd', category: 1 }, | |
{ id: 'e', category: 2 }, | |
{ id: 'f', category: 3 }, | |
{ id: 'g', category: 1 }, | |
{ id: 'h', category: 2 } | |
]; |
const getPhotoFromProfile = profile => { | |
try { | |
return profile.Photographs[0].URLS[0]; | |
} catch (err) { | |
return '/images/placeholder.jpg'; // default to placeholder image | |
} | |
}; | |
const getFullNameFromProfile = profile => `${profile.Christian_Name} ${profile.Surname}`; |
(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.