Really nice feature. Thanks BTW for the real world practical hands-on + rest of the examples you've mentioned in the video.
@sikz263005 жыл бұрын
Thanks for going over this, I'm still having trouble understanding why you'd want to go this route though. At least in the case of the translation example, I'd probably prefer doing something like: (user, language=language)=>{ //lang can be passed in or defaulted to browser/state or something else const {hello,yourBirthdayIs} = getTranslations(language); const {name,birthday} = user; return `${hello}${name}, ${yourBirthdayIs}${birthday}` } But maybe thats just this example, or maybe it just makes me feel dirty using string search to filter out my replacements.
@escapiststupor6 жыл бұрын
Thank you Kent for these wonderful livestreaming!
@gosnooky Жыл бұрын
Reduce the interpolations always (since its length is always 1 fewer than the literals) interpolations.reduce((acc, current, i) => acc + current + literals[i + 1], literals[0]) More succinct this way.
@julianklumpers6 жыл бұрын
What syntax theme are you using? Edit: found it already, its Nightowl. Nice video btw