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

  • Via Twitter

    Via a tweet, but I thought I'd get my own copy. A beautiful illustration of how a caption totally misrepresents what's been captured in the photo.…

  • (no subject)

    Here's an extract from Uncle Bob's book Clean Agile. Although he has fallen out of grace with the champions of social justice, the sentiment…

  • (no subject)

    Twelve thousand people pressed the button. Obviously most of them his followers, but still... interesting:

  • 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