Andrey (azangru) wrote,
Andrey
azangru

Tagged template literals!

They have been around for several years, yet I’ve never had an occasion to actually use them, and thus had no idea what that syntax meant. Apparently they are pretty mainstream in certain communities (e.g. ones that use graphql or styled components).

Example from Relay:

Relay.QL`
  fragment on Greetings {
    hello,
  }
`;


Example from styled components:

styled.h1`
  font-size: 1.5em;
  text-align: center;
  color: palevioletred;
`;


Article on MDN.io
Subscribe

  • (no subject)

    Results of a survey. No idea who those guys are or how reliable their data, but I've been wondering for a while now what people mean when they say…

  • (no subject)

    I'm listening to The Ickabog, by J.K. Rowling and read, with much gusto, by Stephen Fry. What started like a nice children's tale not dissimilar from…

  • (no subject)

    From today's questions to the Prime Minister: Mr Speaker, today, millions of Uyghur people in China live in fear under a cruel regime. The BBC,…

  • Post a new comment

    Error

    default userpic
    When you submit the form an invisible reCAPTCHA check will be performed.
    You must follow the Privacy Policy and Google Terms of use.
  • 0 comments